Walmart (WMT -0.08%) stock has long been something of a contradiction.

As the world's biggest company (based on revenue), Walmart has plenty of competitive advantages, including economies of its scale, store locations within 10 miles of 90% of the U.S. population, and a reputation for low prices that sits at the core of its customer value proposition.

While those components have helped make the business an undeniable success, the stock has underperformed through most of the 21st century. In the first decade, the stock traded sideways as it grew into its valuation following a surge during the dot-com boom. In the second decade, Amazon's (AMZN 3.43%) success weighed on Walmart, and it was seen as vulnerable to the e-commerce giant.

Walmart CEO Doug McMillon in a crowd of Walmart employees

Walmart CEO Doug McMillon Image source: Walmart.

However, the retailer responded to the challenge, adapting its business by investing in pickup and delivery capabilities, and even launching a membership program similar to Amazon Prime, which it dubbed Walmart+. As a result, Walmart stock has been solid in recent years, essentially matching the S&P 500, but the stock's reputation is still weighed down by years of underperformance. As a stock pick, it's about as unsexy as they come. It's a rock-solid Dividend Aristocrat, but investors seem to believe that the brick-and-mortar retailer has limited growth opportunities and is destined to get eclipsed by Amazon.

That perception could be seriously off base. Walmart is on the cusp of a transformation unlike any that a company of its size has ever undergone. And its stock could be the biggest positive surprise on the market over the next 10 years.

It's not your father's Walmart

At Walmart's recent Investment Community Meeting, CEO Doug McMillon echoed Amazon CEO Jeff Bezos's famous Day One declaration, saying, "I've been a part of Walmart for more than 30 years now and I can't remember a time when there was so much exciting change happening inside our company."

While its core retail business may be mature as the brick-and-mortar retail sector is expected to see little growth, Walmart is building a number of high-margin businesses in areas like e-commerce, advertising, fintech, and healthcare, and these could transform the company. 

In just five years, Walmart has gone from being Amazon's victim to being the second-largest e-commerce company in the U.S. It offers pickup and delivery from more than 3,000 stores in the U.S., and its domestic e-commerce sales jumped 79% last year. It's also building out an e-commerce marketplace, partnering with software platforms like Shopify and BigCommerce to grow its stable of third-party sellers. A year ago, Walmart launched Walmart Fulfillment Services, providing services like picking, shipping, and packing to third-party sellers, and generally eliminating the hassles of selling on its marketplace.

Amazon's e-commerce operating margins have grown as its marketplace business has, and Walmart should see a similar effect. Online marketplaces tend to become high-margin businesses at scale as they take advantage of the infrastructure already in place. Management says it plans to reach $100 billion in global e-commerce sales in the next couple of years, and $200 billion a few years after that. By comparison, Amazon finished 2019 with less than $250 billion in e-commerce revenue.

A walmart employee stocks shelves at a store

Image source: Walmart.

In healthcare, the company sees a huge opportunity as well. Most Americans already shop at Walmart. It's the country's biggest grocer and carries a wide range of roughly 100,000 other products. Many of these customers also rely on the retailer for pharmacy and optical services, so it already plays a role in their healthcare. To capitalize on that traffic, Walmart has begun opening health clinics inside its stores. It now has 20 of those nationwide, mirroring the strategy being undertaken by pharmacy giants like CVS and Walgreen's. Management sees healthcare as a natural extension of its business.

Walmart has also launched its own health insurance brokerage. Management has not provided many details about its long-term plan in healthcare, but it's easy to imagine the company, with its leadership in the grocery business, moving further into wellness -- perhaps by partnering with a company like WW International (formerly Weight Watchers), or offering consulting with nutritionists who could craft healthy eating plans for customers, the ingredients for which they could easily pick up at Walmart.

In January, the company announced it was launching a fintech start-up with the help of Ribbit Capital, a venture capital firm that has invested in disruptors like Robinhood and Coinbase. Here again, management has been reticent about its goals, but Walmart has an advantage in its customer relationships, especially with the millions of Americans who are unbanked and underbanked. Management also said customers have asked for more financial services from the company, and Walmart seems to be leaning toward a marketplace of products and services, possibly connecting customers with other financial services providers. Walmart recently hired two Goldman Sachs executives for the fintech, a promising sign for the start-up, and potentially paving the way toward it offering meaningful banking services.

Digital advertising is one of the most profitable businesses around these days, forming the foundation for tech giants like Alphabet and Facebook. Amazon has scaled its own advertising business in the last five years to annual revenue of more than $20 billion, making it the third-largest player in digital advertising, behind Google and Facebook.

Walmart, which was the most downloaded shopping app last year and brings in more revenue than Amazon, has been fast scaling up its own e-commerce business and should also be able to generate billions in advertising profits as it leverages its valuable digital real estate. Five years from now, management predicted it would easily be one of the top 10 advertising platforms in the country, ahead of large media companies TwitterFox Corp., and Hearst. Similarly, the company is also aiming to monetize data in a way it hasn't previously, selling the information generated by its new digital systems. 

Finally, the international e-commerce business presents a huge opportunity. Walmart has reoriented its portfolio to focus on emerging markets such as India, where its Flipkart acquisition is paying off, and where PhonePe (recently spun off from Flipkart) has become a leader in digital payments. India is expected to be the third-biggest economy in the world 10 years from now, so Walmart's investments there should bear plentiful returns. Bloomberg reported earlier this month that Flipkart was exploring going public through a SPAC deal that would value it at at least $35 billion. In 2018, Walmart acquired a 77% stake in the company for $16 billion, valuing it at about $21 billion, so its value has already risen by at least 67%, according to that math.

A customer pushes a cart through the aisles of a walmart store with a sign promoting touch-free checkout.

Image source: Walmart.

The investor opportunity

The best time to buy a stock is when the company has a growth opportunity in front of it but isn't getting any credit for that opportunity from Wall Street. Tesla, for example, was at just such a point in 2019. At the time, the electric car maker was plagued by worries about bankruptcy, but it was also at a tipping point in scale and profitability. Today, the stock is trading at more than 15 times its 2019 low.

Walmart is already nearly a $400 billion company, so it won't see that kind of growth, but based on the potential of the projects discussed above, the stock looks significantly undervalued, trading at a price-to-earnings ratio of 24, compared to 40 for the S&P 500.

Walmart's 2021 guidance won't excite growth investors. Management forecast annual sales growth of 4% or more, and operating income growth of at least 20 basis points after raising wages and making investments in other areas this year. Still, even at the low end, that forecast along with share buybacks and a 1.7% dividend yield would lead to double-digit-percentage total returns for investors even if the stock doesn't experience any multiple expansion, which it should get as profitability goes up. It's difficult to predict where its emerging businesses will be in five to 10 years, but any successes in those areas would only add to the stock's upside.

Walmart has blown opportunities before. It was early to video streaming with Vudu, for example, but it never executed well. That was under prior management, though. Today, the company has so many irons in the fire that at least one of them is bound to pay off, and its success with its e-commerce initiatives should reassure investors. Additionally, its shift in focus to higher-margin services constitutes a sea change in the company's philosophy, and it's one that should benefit shareholders.

There are no sure things in the stock market, but for Walmart to be valued like a stodgy retailer (especially in today's frothy environment) sure seems like a mistake.