Baidu (NASDAQ:BIDU) once owned a 45% voting stake in online travel agency (OTA) Qunar. A partnership between China's biggest search engine and one of its top OTAs seemed wise, but Qunar's margins eventually crumbled as it engaged in a brutal price war with its top OTA rival Ctrip.com (NASDAQ:TCOM).

In late 2015 Baidu traded its entire stake in Qunar for a 25% voting stake in Ctrip. That move, which turned Ctrip into Qunar's top investor, ended the price war between the two OTAs, and Ctrip's growth and margins stabilized.

A model airplane on a world map, with a person booking tickets online in the background.

Image source: Getty Images.

Unfortunately, the slowdown in the Chinese economy, trade tensions, and troubles in Hong Kong -- a top travel hub for domestic and international visitors -- caused Ctrip's stock to tumble more than 40% over the past two years. That's why it wasn't surprising when Ctrip recently disclosed that Baidu would sell roughly 30% of its stake, or 31.3 million of its shares, for about $1 billion.

Baidu will remain Ctrip's top investor, but the sale casts another dark cloud over the OTA, which recently lowered its third-quarter revenue forecast (to 10%-15% annual growth) due to the Hong Kong protests, fewer trips to Taiwan amid escalating cross-strait tensions, and lower airfare prices. However, the sale could be a smart move for Baidu.

Streamlining its core businesses

Baidu's investments in Qunar and Ctrip were part of its push into O2O (online-to-offline) services to expand its business beyond its core search engine.

The core of that O2O ecosystem was Nuomi, a group-purchase e-commerce platform Baidu bought from social media company Renren (NYSE:RENN) in 2013. Baidu expanded Nuomi into an O2O platform that provided other services as well, including travel booking, ticket sales, ride-hailing, food delivery, digital payment, and more. By 2016, Nuomi's travel and ride-hailing services were completely powered by Ctrip and Qunar's platforms.

Baidu's O2O strategy was a direct response to Tencent's (OTC:TCEHY) expansion of WeChat, the top mobile messaging app in China with over 1.1 billion monthly active users (MAUs), into an all-in-one platform for payments, ride-hailing services, deliveries, and other services.

A person accessing a travel app on a smartphone.

Image source: Getty Images.

In early 2017 Tencent expanded that ecosystem with Mini Programs, which allowed third-party companies to develop apps that ran within WeChat. Last November it announced that it had hit a million WeChat Mini Programs, with 200 million daily active users (DAUs).

Meanwhile, Nuomi struggled to remain relevant, and Baidu realized that its "super app" strategy was crumbling. It sold its food delivery unit in 2017, sold Nuomi to its video streaming unit iQiyi (NASDAQ:IQ), and sold most of its fintech services unit (which runs Baidu Wallet) earlier this year.

Baidu then followed Tencent's lead and launched a "Smart Mini Programs" platform for third-party companies for its core Baidu app last year. Last quarter Baidu stated that the app's DAUs rose 27% annually to 188 million in June, and subsequently hit 200 million DAUs in August. It also claimed that MAUs for its Smart Mini Programs hit 270 million in June, representing 49% growth in just three months.

In short, Baidu realized that Tencent's approach was smarter than its clumsy O2O strategies with Nuomi, and that it needed to streamline those efforts and leverage its strongest asset -- its search engine app -- to lock in more developers and users. Reducing its stake in Ctrip, which already runs a mini program on Baidu's platform, complements that strategy and raises some fresh cash for other purposes.

Where will Baidu spend that $1 billion?

Citi analyst Alicia Yap and Jefferies analyst Thomas Chong both suggested that Baidu could spend the proceeds from the sale on buybacks. I respectfully disagree, since Baidu's previous buybacks were wasteful moves that merely caught the stock on the way down.

Those analysts might argue that Baidu's stock has finally bottomed out after being cut in half over the past 12 months, since its second-quarter earnings and third-quarter guidance indicated that its growth was stabilizing. That might be true, but Baidu still relies heavily on the growth of iQiyi -- a deeply unprofitable business -- to offset the slowdown of its core advertising business.

Companies should generally only focus on buybacks when they run out of room to grow, and that's not the case with Baidu. It would be arguably smarter for Baidu to spend $1 billion on its ongoing investments in forward-thinking markets -- like its AI platform DuerOS, its smart speakers and Internet of Things (IoT) gadgets, and its autonomous driving platform Apollo -- instead of simply treading water with buybacks.