Investors--and the press--seem to think that Uber has made a smart deal in China. And one that couldn't have been closed soon enough. 

Now that Uber has announced it is merging its Chinese operations with Didi Chuxing, the company can focus its efforts on a potential initial public offering--and boosting profits elsewhere around the globe.

The merger ends a two-year locked-horns battle that caused both companies to pour billions into winning over Chinese riders. After the merger, Didi is valued at $35 billion--and is investing $1 billion back into Uber. Its CEO is also taking a seat on Uber's board.

Despite launching its ride-hailing product in China a full year before Didi did, Uber struggled against the home team, which came to bat with powerful investors and was able to maneuver quickly to adapt to local regulations and impress local press. Also, it didn't help that local taxi-hailing technologies were already thriving--and plenty of customers had already found their favorite.

"I have no doubt that Uber China and Didi Chuxing will be stronger together," Uber founder Travis Kalanick wrote on Uber's blog upon the announcement Monday, which was first reported by Bloomberg.

As Didi grew over the past two years, Uber's main rival in the United States, Lyft, took a very different approach to dealing with that than did Uber.

Instead of launching in the Chinese market on its own, Lyft joined a global ride-hailing consortium of sorts, which included Didi, Ola, and GrabTaxi. And Lyft's relationship with Didi only grew stronger over time; the two companies integrated their technology over the past year so that when a U.S. traveler with Lyft opens the app in China, it automatically syncs with Didi's system, and allows the traveler to hail a Didi car. And vice versa for Chinese travelers who voyage to major U.S. cities where Lyft operates.

Now, interestingly, Uber is following Lyft's lead. It will be fascinating to see whether the fact Didi is invested in both Uber and Lyft influences their behavior globally.

And a big question is raised: Should Uber have caved earlier? Quite possibly. Founder Kalanick writes in Monday's announcement that "as an entrepreneur, I've learned that being successful is about listening to your head as well as following your heart." In my years of reporting on Uber, and multiple experiences interviewing Kalanick, it's become clear to me that this is not a CEO whose mind is easy to change--because his resolutions come from the gut (or, sure, as Kalanick puts it, the heart). It seems like this was certainly has been something long-pondered for Uber.

While Uber has been profitable in most of the developed world since 2015, it has spent more than $1 billion in China each of the past two years. That simple fact has led Uber investors to clamor for the company to sell its Chinese operations in order to focus on further growth elsewhere, according to Bloomberg.

Now that Uber China has joined hands with its biggest rival there, Uber is freed up to conquer its other goals. Those close to the company have said that the sheer amount of money the company had been pouring into China had been a sticking point, preventing Uber from preparing for an initial public offering. Now, the path to IPO is a lot more clear for Uber.

So is the ability to choose its battles elsewhere around the globe. While Uber is in 450 cities, it isn't the dominant ride-hailing option everywhere. In Southeast Asia, there's Grab. In India, there's Ola. Where this all gets tricky is that Didi has already invested heavily in both these companies. Will Uber still have the same incentive--or ability--to take them on?

Now, the question remains: It's been three years of pouring billions into growing their businesses in China. Now that Didi controls 99 percent of the ride-hailing market there, will its road to profitability be a straight, short one? Now that Uber is also invested in Didi's success, that would be good for everyone.