Baidu (BIDU 0.72%) and Tencent (TCEHY -0.94%), two of the largest tech companies in China, both recently posted their second-quarter earnings. And there was a stark difference between the two reports.

Baidu's revenue dipped 1% annually and missed analysts' expectations, but its 46% jump in adjusted earnings beat estimates. Tencent's revenue and adjusted earnings rose 29% and 28%, respectively, easily clearing expectations on the top and bottom lines.

Baidu's bottom line beat was driven by a significant reduction in its expenses, as it focused on "optimizing profitability over revenue growth." Meanwhile, Tencent generated robust double-digit growth across its core gaming, advertising, and fintech and business services units.

A frustrated investor looks at a wall of stock tickers.

Image source: Getty Images.

I compared these two companies back in April, and declared Baidu's stock would "likely trail" Tencent's for the foreseeable future. Tencent's stock rallied more than 20% since I wrote that article, but Baidu's only rose about 10%. Let's see if that trend will continue through the rest of the year.

What went wrong for Baidu?

Baidu owns China's largest search engine, but internet users in China are spending more time on other platforms.

Those competitors include Tencent's WeChat, the top messaging app in China; ByteDance's short video app Douyin and news app Jinri Toutiao; Bilibili's (BILI -1.96%) digital platform for anime, comics, and gaming content; and Alibaba's (BABA 0.64%) online marketplaces, which attract more advertising revenue with their product listings than any other company in China.

Tencent and ByteDance have also integrated internal search engines into their apps. Tencent even recently launched a takeover bid for Sogou (SOGO), Baidu's biggest rival in online and voice searches, to expand its external search features.

That competitive pressure, along with other macro headwinds, caused Baidu's online marketing revenue -- which accounted for 67% of its top line -- to decline 8% annually during the second quarter. That marked the segment's fifth consecutive year-over-year decline in revenue.

Meanwhile, Baidu's video streaming unit iQiyi (IQ), which accounted for 27% of its top line, grew its revenue 4% annually. That growth partly offset the weakness of its advertising business, but it's problematic: iQiyi isn't profitable, and the SEC is now probing the company following allegations of fraud earlier this year.

For the third quarter, Baidu expects a 6% year-over-year decline to 2% growth in revenues. It didn't offer any earnings guidance, but it will likely focus on cutting costs at its advertising business again to conserve cash for newer efforts like its cloud platform, AI services, and Mini Programs. But that lopsided strategy could leave it even more vulnerable to competing ad platforms.

For the full year, analysts expect Baidu's revenue to rise 1% as its earrings decline 12%. That's an unimpressive growth rate for a stock that trades at 20 times forward earnings.

What went right for Tencent?

Tencent's business is better diversified than Baidu's. Its gaming business generated 34% of its revenues in the second quarter, followed by its fintech and business services unit (26%), value-added services on its social media platforms (23%), and online ads (16%).

A gamer plays a smartphone game.

Image source: Getty Images.

All four businesses generated double-digit revenue growth during the quarter, led by the online gaming unit's 40% growth. That core business benefited from the strength of hit smartphone games like Peacekeeper Elite and Honor of Kings. Tencent's advertising revenue also rose 13%, indicating advertisers were still buying plenty of ads on WeChat, QQ, and its mobile ad network.

Value-added services revenue from Tencent's social media platforms -- including virtual gifts, subscriptions, and other transactions -- rose 29%. That growth indicated WeChat (known as Weixin in China) was still squeezing out more revenues from its 1.2 billion monthly active users. The Trump Administration recently threatened to ban WeChat in the U.S., but the American market accounts for fewer than 2% of its daily active users.

Tencent's fintech and business services revenue surged 30%, buoyed by the rising usage of its payment, wealth management, and cloud services. That growth widens Tencent's moat against Alibaba and its fintech affiliate Ant Financial.

Simply put, Tencent easily weathered the COVID-19 crisis and is firing on all engines again. It didn't provide any guidance, but analysts expect its revenue and earnings to rise 28% and 29%, respectively, for the full year. Tencent's stock isn't cheap at nearly 40 times forward earnings, but its wide moat and ongoing growth arguably justify that premium.

Reiterating my earlier call

I own shares of both companies, but Baidu clearly faces more challenges than Tencent. Baidu is trying to reinvent itself with Mini Programs for its mobile app, its DuerOS virtual assistant, cloud services, and driverless cars -- but that turnaround is sluggish and its core advertising business is stuck in a rut. The SEC investigation into iQiyi also raises major red flags.

Tencent's growth is more stable, and the company clearly pulling users away from Baidu and other older internet platforms with its sprawling ecosystem of games, social media apps, Mini Programs, and payment services. Therefore, Tencent should easily outperform Baidu throughout the rest of 2020, unless the search giant fixes its core advertising business.