Alibaba (BABA -0.94%) and Amazon (AMZN -1.35%) are two of the world's largest e-commerce and cloud infrastructure companies.

Alibaba owns the largest online marketplaces in China, and Alibaba Cloud is the country's leading cloud platform. Amazon is the e-commerce leader in the U.S., Europe, and other markets, and it owns AWS (Amazon Web Services), the largest cloud platform in the world.

A woman uses an e-commerce app on a tablet.

Image source: Getty Images.

Alibaba went public six years ago, and its stock has risen nearly 300% from its IPO price. But Amazon's stock surged more than 830% during the same period. Let's see why Amazon attracted more bulls than Alibaba, and whether or not that trend will continue.

The differences between Amazon and Alibaba

Amazon generates most of its revenue from its online marketplaces, which include a mix of its own offerings and products from third-party sellers, but it generates most of its profits from AWS.

AWS' higher-margin revenue enables Amazon to expand its e-commerce business with lower-margin strategies, including discounts, free shipping options, cheap hardware, and digital perks for Prime subscribers. It also supports the ongoing expansion of the company's brick-and-mortar stores.

Alibaba, which also generates most of it revenue from its online marketplaces, doesn't take on any inventories. Its top Chinese marketplaces, Taobao and Tmall, are paid listing platforms that link buyers to sellers, and its logistics unit Cainiao fulfills those orders.

This less capital-intensive approach keeps Alibaba's core commerce business profitable. However, its other three businesses -- Alibaba Cloud, the Digital Media and Entertainment unit, and the Innovation Initiatives unit -- are not. Therefore, Alibaba subsidizes the growth of these unprofitable segments with the core commerce segment's profits.

Amazon is firing on all cylinders

Amazon's revenue and earnings rose 20% and 14%, respectively, in 2019. But in the first nine months of 2020, Amazon's revenue rose 35% year-over-year as its earnings surged 68%.

That acceleration was attributed to the COVID-19 crisis, which significantly boosted its online sales and the usage of AWS-based cloud services. Its Prime ecosystem, which surpassed 150 million subscribers at the end of 2019, likely continued expanding during the pandemic.

AWS' revenue rose 30% to $32.6 billion, or 13% of Amazon's top line, during those nine months. The cloud unit's operating profit jumped 51% to $10 billion, or 62% of its operating income -- and its operating margin expanded year-over-year from 26.3% to 30.5%.

Those numbers indicate AWS isn't losing ground to its top cloud rival, Microsoft's Azure. It also indicates AWS' profits will keep supporting the growth of Amazon's online marketplaces. 

Amazon's North American unit's operating margin contracted year-over-year during the first nine months, mainly due to higher COVID-19 safety expenses and fulfillment costs, but its international business finally generated a slim operating profit after years of operating losses.

Analysts expect Amazon's revenue and earnings to rise 35% and 52%, respectively, this year. Next year, they expect its revenue and earnings to rise 18% and 30%, respectively, as the pandemic passes.

Alibaba faces a few growing pains

Alibaba's revenue rose 35% in fiscal 2020, which ended on March 31, and its adjusted earnings rose 38% (which exclude its acquisition of a 33% stake in its fintech affiliate Ant Group and other one-time gains and losses).

Alibaba's campus in Hangzhou, China.

Image source: Alibaba.

In the first half of fiscal 2021, Alibaba's revenue grew 32% year-over-year as its adjusted earnings rose 28%. Unlike Amazon, Alibaba didn't experience a huge uptick in pandemic-induced sales, for two reasons.

First, Alibaba faces more online competitors in China, including JD.com and Pinduoduo, than Amazon faces in its other top markets. Second, China largely contained the pandemic by April, which limited its overall impact on online sales.

Alibaba is also relying more heavily on the core commerce business' lower-margin segments -- including brick-and-mortar stores, cross-border marketplaces, and Cainiao -- to boost the segment's growth. But that strategy reduced its core commerce unit's adjusted EBITA margin year-over-year from 40% to 37% in the first half, and that erosion could continue -- and ultimately impact its ability to support its unprofitable cloud, media, and innovative business segments.

Analysts expect Alibaba's revenue and earnings to rise 47% and 36% this year, respectively, as its growth improves in the second half. Next year, its revenue and earnings are expected to grow 31% and 21%, respectively.

However, those forecasts could still be derailed by the recent failure of Ant Group's IPO, which was expected to boost Alibaba's profits, and new antitrust rules aimed at reining in Alibaba and other Chinese tech giants.

The valuations and verdict

Amazon trades at 58 times forward earnings, while Alibaba has a much lower forward P/E ratio of 28.

Investors are paying a premium for Amazon's stock because its e-commerce and cloud businesses have been growing like weeds throughout the pandemic. Meanwhile, Alibaba's valuation seems depressed by the Ant Group debacle and new regulatory threats in both China and the U.S.

I personally own Amazon instead of Alibaba, but I think Alibaba's long-term growth potential and valuation make it a better buy right now. Alibaba's stock will remain volatile, but it's still China's top e-commerce and cloud company -- and its stock is far too cheap relative to its earnings growth.