Social distancing has more people shopping for groceries online instead of going into crowded stores that might not even have every item they need in stock. One-third of shoppers surveyed by Gordon Haskett Research Advisors last Friday said they bought groceries online last week. It was their first time buying groceries online for 41% of those shoppers.

Among those new online grocery shoppers, one retailer is preferred far more than others. Walmart (NYSE:WMT) captured 58% of all orders, according to the survey. The next closest competitor is Amazon (NASDAQ:AMZN), with just 14% of orders from new online grocery shoppers. America's second-biggest physical grocery retailer, Kroger (NYSE:KR), accounted for 6% of new orders.

A man in a Walmart vest loading groceries into the trunk of a car.

Image source: Walmart.

More than just defending market share

Walmart is the leading grocery retailer in the U.S., with about one-quarter of all grocery sales going to the big-box retailer. Grocery sales account for 56% of Walmart's total revenue, so as more people start buying their everyday household items online, it's imperative for Walmart to win those sales.

Over the last few years, the company's stepped up its ability to serve customers online through curbside pickup and delivery. It now has over 3,200 pickup locations and delivery from over 1,600 stores. Meanwhile, its product selection continues to expand beyond just basic groceries to include everyday household essentials like beauty products and cleaning supplies. Last fall, it introduced a grocery delivery subscription service, Delivery Unlimited, and it's planning to expand the benefits of the subscription this year.

In other words, Walmart's been preparing for the shift to online grocery shopping for years. And while everyone may have wished for it to come under better circumstances, the current COVID-19 pandemic has produced an excellent environment for consumers to make the change.

And Walmart isn't just defending its bread-and-butter business; it's winning new sales. Grabbing 58% of new online sales ought to boost Walmart's market share of the overall grocery market. And if Walmart can maintain anywhere near those levels, it should see continued gains as more spending shifts online.

Just 3% of U.S. grocery spending took place online last year. That compares to rates around 15% in the U.K. and Korea. That leaves a lot of room to run for Walmart's online efforts.

Amazon also stands to gain. Its 14% share of new online sales (and current market lead in online grocery) is well above its overall market share of less than 2%. Amazon's stepping up efforts in grocery as well, expanding its delivery footprint with AmazonFresh and Prime Now, and it also has plans to open a new grocery chain this year that will likely emphasize online ordering.

Kroger, meanwhile, could be a market share loser. With over 10% of the overall market, a failure to attract a large percentage of shoppers to its online ordering platform could results in an overall sales decline as more spending moves online.

Is Walmart cannibalizing itself?

The concern for investors as more grocery sales shift online is that a significant portion of Walmart's online grocery sales will come from shoppers that would have otherwise gone into a Walmart store. While some cannibalization is inevitable, investors really want to see Walmart taking sales from smaller competitors.

To that end, Walmart's same-store sales growth over the last couple of years suggests it's gaining share. Comparable-store sales increased 2.8% in fiscal 2020 after improving 3.6% in 2019. Walmart forecasts another 2.5% increase in comparable-store sales this year, and it's all fueled by the growth of its online platform.

That said, the market share gains Walmart can make won't be as great as Amazon's ability to win share. Since it has such a small share of the grocery market as is, the rise of online grocery represents mostly a greenfield opportunity for Amazon.

With new customers trying out online grocery shopping this month due to public health concerns, it's likely many of them will stick around and continue shopping that way. "We see this unfortunate period accelerating structural changes in consumer shopping," Credit Suisse analyst Seth Sigman noted. Walmart is certainly well-positioned to absorb those changes, and its very early results with new online grocery shoppers show as much. Don't discredit Amazon's relative success, however, considering it's currently far less exposed to the grocery industry compared to Walmart.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.