Walmart (WMT -0.65%) has been investing aggressively in e-commerce. In fact, nearly three-quarters of the company's net sales growth came from its online operations last year. Management expects the digital platform to account for more than half of its total top-line growth in fiscal 2021.

All told, management expects e-commerce to reach $50 billion in global net sales over the next 12 months. That's quickly approaching 10% of the company's total sales.

By comparison, Amazon (AMZN -1.14%) just reported 2019 online sales of $141 billion, in addition to $54 billion in third-party seller services and $35 billion in subscription services. Its advertising business also added another $10 billion or so. Add them all up -- and even with conservative growth expectations for this year -- Amazon's still more than five times the size of Walmart's massive e-commerce business.

Lets dive into Walmart's $50 billion net sales outlook for its e-commerce business, and see where it goes head-to-head with Amazon in key growth opportunities.

Walmart boxes coming down a conveyor belt.

Image source: Walmart.

India's massive and growing quickly

Walmart acquired a 77% stake in Indian e-commerce giant Flipkart about 18 months ago. Flipkart and its digital payment subsidiary, PhonePe, generated about $6 billion in revenue last year. Walmart's share of that is about $4.7 billion. That's considerably more than the roughly $2.5 billion Amazon generated between its wholesale and marketplace businesses in the country in fiscal 2019.

What's more, Flipkart is still growing quickly. Its top line increased 42% last year, only a slight slowdown from 50% growth in the prior year. By comparison, Amazon realized a setback in its wholesale business following the implementation of new foreign investment regulations. Sales for the segment fell 8%. Meanwhile, the smaller marketplace business grew 54% year over year.

While Flipkart is growing the top line quickly and will easily account for more than 10% of Walmart's $50 billion e-commerce business (compared to India accounting for about 1% of Amazon's), its operating losses are a bit of a concern. Flipkart is investing aggressively in various parts of its business, including logistics and payments. Those investments led to its net loss doubling in fiscal 2019 on an adjusted basis. By comparison, Amazon's operations in India are moving toward profitability despite slower growth.

All about grocery in the U.S.

Walmart's U.S. e-commerce business is growing quickly. Online sales climbed 37% last year, and management expects it to grow another 30% this year. But practically all of that growth is being driven by its online grocery platform. Walmart's quickly expanded click-and-collect to 3,200 stores, and delivery to 1,600 stores.

CEO Doug McMillon says there's still room to grow the online grocery business through expansion to more stores as well as growing sales from the same stores. However, he declined to give details on comparable-sales growth during an investor meeting coinciding with the release of its fourth-quarter results.

But Walmart's grocery business will face a renewed attack from Amazon this year. The latter dropped the monthly fee for AmazonFresh at the end of last year and it's launching a new physical grocery chain this year. The online retail leader has a clear interest in driving grocery sales, as they lead to higher frequency purchases compared to general merchandise.

If Amazon's efforts in grocery catch on, it could have a considerable impact on Walmart's online grocery sales growth. And since grocery plays such an important role for Walmart's U.S. e-commerce business, it could result in disappointing results. Management said it expects quarterly U.S. online sales growth to come in anywhere between 25% and 35% each quarter in fiscal 2021, so there's some wiggle room in the outlook. Still, investors should expect stronger growth in the early part of the year considering it has easier comparables. (Growth accelerated in the third quarter last year.) If results come in on the low end, it could be a sign that it's losing market share of online grocery to Amazon.

Additionally, profitability has also been a sticking point for Walmart's U.S. business. Management expects flat net losses compared to fiscal 2020 despite a 30% increase in revenue.

Walmart is betting big on e-commerce to drive top-line growth for the company. But as the business approaches $50 billion in annual net revenue, growth will become harder to come by as it butts heads with Amazon in key markets. Management's very optimistic it can overcome the challenge of its biggest online retail rival.