In the retail world, there's Walmart (WMT -0.32%) and Amazon (AMZN -1.11%), and then there's everybody else.

Combined, the two companies brought in nearly $1 trillion in revenue last year. Walmart is the world's biggest company by revenue, generating $559 billion, while Amazon is not far behind with $386 billion, adding more than $100 billion in sales just last year.

A man holding two stacks of coins on a scale

Image source: Getty Images.

For investors, Amazon has been the clear winner, as the e-commerce giant has scaled up its profits in recent years thanks to businesses like cloud computing, its third-party marketplace, and advertising. As you can see from the chart below, Amazon has outperformed Walmart by a wide margin over the last five years, while Walmart shares have only matched the S&P 500.

AMZN Chart

AMZN data by YCharts

However, past performance isn't a guarantee of future returns, and both companies are changing rapidly. Let's take a look at what each of these retail titans has to offer and determine which one is the better buy.

An open Amazon box

Image source: Amazon.

Amazon: From e-commerce to everything

The last year has made Amazon's dominance clear. Already the country's second-biggest company by revenue, it grew sales by 38% in 2020, shredding the law of large numbers, which says that growth will slow as companies get bigger. The pandemic showed that Amazon offers investors both the benefits of an essential consumer staples company, supplying products like toilet paper and sanitizing wipes, and the scale and growth of a tech company, with its leadership in cloud infrastructure, the rapid growth of its digital advertising business, and its emergence in areas like voice-activated technology.

Not only did Amazon's revenue soar last year, but its profits nearly doubled. After decades of investing in fulfillment infrastructure and its Prime loyalty program, the company is now quickly gaining operating leverage, entering a new phase of the business. Net income jumped $11.6 billion in 2019 to $21.3 billion last year, even as Amazon faced billions in COVID-19-related costs. Much of the company's growth is now coming from high-margin businesses like cloud computing, advertising, its third-party marketplace, and fulfillment, all of which stem from the strength of its e-commerce business and its reputation for pleasing customers. 

That bodes well for Amazon even as the tailwinds from the pandemic begin to roll off, and it still seems like Wall Street is underestimating its profit potential. At this point, Amazon may be its own worst enemy as potential antitrust investigations seem to be the biggest threat to the business. Additionally, Founder and CEO Jeff Bezos plans to step down later this year, though he'll remain on as executive chair when Amazon Web Services CEO Andy Jassy takes the reins. While that isn't a risk in the near term, a new CEO could mean a change or weakening in culture over the longer term. This would be a negative for long-term investors, so they should keep an eye on the transition.

A Walmart truck on the highway

Image source: Walmart.

Walmart: A changing retail behemoth

When you think of Walmart, you probably picture one of its cavernous superstores, selling everything from groceries to sporting goods to T-shirts, but the Walmart of today is becoming much more than a brick-and-mortar chain. The company has invested heavily in its e-commerce infrastructure, adding grocery pickup and delivery capabilities to most of its U.S. stores, offering free one-day delivery with an order minimum of $35, and introducing Walmart+, a loyalty program with similar benefits to Amazon Prime. It's also building its own e-commerce marketplace, challenging Amazon in an area where it's essentially had a monopoly. That's helped make Walmart the No. 2 e-commerce business in the country, with U.S. e-commerce sales growing 69% last year.

Beyond e-commerce, Walmart is focused on using its stores to leverage growth in newer, higher-margin businesses, much like Amazon has done with its first-party e-commerce business. For example, Walmart is opening health clinics inside its stores and has launched a health insurance brokerage. Having stores within 10 miles of 90% of the U.S. population gives the company a competitive advantage in terms of physical access, and adding health clinics seems like a natural fit, as Walmart is already a frequent destination for so many Americans. 

Walmart is also launching a fintech business with the help of Robinhood-backer Ribbit Capital. Details are sparse at this point, but the company recently pitched to Goldman Sachs execs for the start-up, a promising sign. Digital payments seem like another promising growth area for a company that already has a relationship with customers who are unbanked or underbanked.

Finally, Walmart sees an opportunity in data monetization and advertising, leveraging its own knowledge and digital real estate to sell to suppliers and brands. Its newly rebranded advertising business, Walmart Connect, is already seeing traction. Advertising platform Pacvue said a consumer packaged goods brand has doubled its spending with Walmart since March 1, after getting increased return on investment.

With its e-commerce solidifying its retail strength, Walmart has an opportunity to improve margins with new businesses in areas like healthcare, fintech, and data.

Which is the better buy?

Both of these companies have their own distinct set of strengths, which includes the dominance of their respective corners of the retail industry. Amazon is more likely to appeal to the growth investor, while Walmart is a better fit for value or income seekers. 

I think both companies are poised to outperform the S&P 500 over the coming years. But of the two, Amazon seems like the more reliable choice, given the company's track record, fast-growing profitability, and manifest competitive advantages in areas like its Prime loyalty program, its massive fulfillment network, and its reputation for customer satisfaction. 

While Walmart's new business ventures are exciting and certainly worth watching, its core business as a brick-and-mortar retailer is in a slow-growth industry. Therefore, Amazon has a growth advantage and is also quickly gaining leverage on the bottom line. It's the better choice here.