Earlier this month, China-based ride-hailing company Didi Chuxing bought Uber China. It was a notable purchase because the two companies have been in a bitter, and expensive, pricing war in the country for the past few years. 

Didi was already winning most of the battles, while Uber was spending $2 billion in two years just to keep up.

Several people share a ride in a car.

Image source: Getty Images.

The deal is essentially the best of both worlds for both companies. In exchange for Uber China's brand, business, and all of its data Didi is investing $1 billion in Uber's global business and Uber gains a 17.7% stake in Didi. 

The two companies will also share board seats with each, with Didi's founder and CEO Cheng Wei joining Uber's board and Uber CEO Travis Kalanick going to Didi's. 

Didi Chuxing already delivers 11 million rides every single day in China and says it has 87% of the ride-hailing market. That's now closer to 100%.  

Didi's presence is in more than 400 cities across China and received a $1 billion investment from Apple back in May, as well as a slew of other investments that put Didi's valuation at $28 billion. But the Uber deal pushes up the company's valuation to $35 billion. That's impressive, but still far short of Uber's $68 billion.  

Uber's biggest gain in the deal is probably in the fact that it's now much freer to pursue an IPO. The company's investors reportedly wanted Uber to get out of China before the company went public because the Uber was spending so much money in the country. 

Didi Chuxing is nearly unstoppable

Didi not only gains Uber China's business in the deal, but it also eliminates a key competitor in the county. Now Didi is free to dominate the space as it sees fit. 

But it also gives Didi a stake in yet another ride-hailing company. Didi has already partnered with Ola, the largest ride-hailing service in India, and Grab, the largest in Southeast Asia, as well as Lyft, the second-largest in the U.S.

Apparently, Lyft is getting cold feet about its current partnership with Didi after the Uber deal and has said it's reevaluating its relationship with Didi. Before, Lyft users could use their app to hail Didi rides while traveling in China, and vice versa. Lyft never entered China, saying that it realized there were too many policy changes and regulations in the country. 

So Didi has essentially won the ride-hailing war in China and Uber walks away with a large stake in Didi and a significant investment. Meanwhile, dark clouds appear to be forming over Lyft. 

It'll be interesting to see how Didi expands once the deal is completed (it still needs to pass regulatory approval). China is the largest automotive market in the world and the ride-hailing segment is still at the beginning stages.

The better Didi performs in China, the better Uber will now do in China as well. And with a possible IPO on the horizon, that's far more than Uber could have ever asked for.