Walmart (WMT -1.22%) stock has had an incredible run over the last few years. Since the end of 2022, the stock has doubled in value and sits close to an all-time high. Walmart shares have trounced the Dow Jones Industrial Average (^DJI -0.77%), which has returned 35%.

But investors shouldn't assume that Walmart's stock performance is the result of accelerating growth in its business. There hasn't been a noticeable change in the company's growth trajectory. For the full year, Wall Street analysts expect the company's sales to increase by 5.3%, compared to a 6.7% increase in fiscal 2023 (which ended in January).

Stocks can make huge moves if a company shows a significant increase in profitability, or earnings per share (EPS). While Walmart is showing double-digit growth in earnings, the 11.8% expected increase for the current fiscal year may not be enough to justify its current share price, especially when another Dow Jones stock is offering more growth at a comparable price-to-earnings (P/E) multiple.

Amazon's (AMZN -1.45%) sales are expected to grow 11% for 2024, with earnings expected to increase by 77% this year, as the company optimizes its cost structure. Importantly, investors can buy Amazon shares for 43 times this year's earnings estimate, compared to a forward P/E of 38 for Walmart. That's a reasonable premium to pay for a stock that is growing earnings at significantly higher rates.

Wall Street Estimates Walmart Amazon
Full-year sales growth 5.3% 10.9%
Full-year EPS growth 11.8% 77%
Long-term annualized EPS growth 9.2% 23.2%
Forward P/E 38.1 42.5

Data source: Yahoo! Finance and YCharts. Chart by author.

Amazon has a massive lead in e-commerce

Amazon is winning in more ways than just retail. Retail sales made up only 42% of Amazon's business in the third quarter. The rest of its sales are generated from services, including advertising and cloud computing, which generate higher margins than retail sales and are growing at high double-digit rates year over year.

One area where Walmart is growing faster than Amazon is e-commerce. It posted an increase of 27% in the most recent quarter, compared to Amazon's 8% online sales increase, but this can be attributed to Walmart's e-commerce business growing from a smaller base of sales.

In 2023, Amazon's share of U.S. e-commerce was 37%, according to Statista. Walmart was a distant second, controlling just 6% of the U.S. e-commerce market. Amazon is using the high traffic on its website to offer ad services to third-party merchants to advertise on product pages. Over the last year, Amazon generated $53.5 billion in trailing revenue from ad services. Along with strong growth in its cloud business and better cost management in retail, this is helping drive robust earnings growth.

Walmart is benefiting from similar opportunities outside of retail. Its advertising business grew 28% year over year last quarter. Walmart is also investing in automation in its supply chain and generative artificial intelligence (AI) tools to improve the customer experience and efficiency at its fulfillment centers. Amazon is investing in similar initiatives and still delivering higher earnings growth.

This growth stock should keep winning

Analysts expect Amazon's earnings to grow 23% on an annualized basis over the next several years, while they expect Walmart's earnings to grow 9%. Unless Walmart significantly accelerates its earnings growth, the stock could revert back to its previous 10-year average P/E of 28, which would cause a short-term sell-off in the share price.

This isn't to say that Amazon shares couldn't also fall, but its superior growth provides more justification for its valuation. Because of this, I would bet on Amazon stock to outperform Walmart in 2025 -- and over the long term, too.