Wal-Mart (NYSE:WMT) reported another quarter of strong year-over-year online sales growth. Net sales increased 60% in the second quarter, following a 63% increase in the first quarter. And while Wal-Mart has been on a tear buying up smaller e-commerce companies, management says the majority of its growth is coming from Walmart.com.

One of the big factors pushing Walmart.com sales higher is its rapidly growing third-party marketplace. But perhaps more important is Wal-Mart's success with online grocery and pickup. As the largest grocer in the United States, Wal-Mart is paving the way for online grocery ordering, which is extremely important as Amazon (NASDAQ:AMZN) prepares to enter the market via its acquisition of Whole Foods Market (NASDAQ: WFM).

Walmart associate loading groceries into the back of a minivan.

Image source: Wal-Mart.

The growth of Wal-Mart's online grocery business

Over the past year, the number of Wal-Mart stores fulfilling online grocery orders has more than doubled. The service was available in 400 stores as of the end of the second quarter last year, and it's now available in over 900 stores. The growth accelerated in the second quarter when Wal-Mart added over 230 locations for online grocery ordering pick-up.

The rapid expansion has resulted in Wal-Mart winning back share of the grocery market. In the first quarter, Wal-Mart's same-store grocery sales growth of 2.6% outpaced the overall grocery industry. Last quarter, sales growth was even better -- the best in five years, management said.

Wal-Mart recently started testing stand-alone kiosks that fulfill orders 24/7. Customers simply drive up, enter a code, and their groceries are ready to load within 60 seconds. Amazon is testing a similar service in Seattle.

Amazon is getting in at just the right time

While Amazon has been working on online grocery ordering for over a decade, its planned acquisition of Whole Foods announced its intentions to take on the market in a big way. Interestingly, Whole Foods was ranked at the bottom of the list of grocers most equipped to capitalize on the growth of online ordering in a report by Citi Research earlier this year. Wal-Mart notably topped the list. The addition of Amazon's online presence and its management team could help Whole Foods quickly climb that list.

It's worth noting that one of the reasons Whole Foods was on the bottom of that list is because of its stores' overlap with Amazon's AmazonFresh grocery delivery market. That said, Amazon can use the stores as a pickup point to make AmazonFresh more affordable for customers who don't require delivery. AmazonFresh currently costs $15 per month on top of a Prime subscription fee (usually $99 per year).

Whole Foods also offers around 450 stores across the country to serve as either pickup points or fulfillment centers for delivery. And using Amazon's logistics capabilities, it can quickly start competing with Wal-Mart. It'll have to act quickly, though, as Wal-Mart is pushing the pedal to the metal with its online grocery ordering and pickup rollout.

Online grocery shopping in the U.S. could grow fivefold over the next decade to $100 billion, according to Food Marketing Institute and Nielsen. While most of that will cannibalize Wal-Mart's sales, it's mostly an untapped market for Amazon. Amazon and Whole Foods combine for just 1.4% of the U.S. grocery market, Wal-Mart controls about 14.5% of the market. While online grocery sales can help Wal-Mart continue winning share of the market, it won't have nearly the same impact as it could for Amazon and Whole Foods.

John Mackey, CEO of Whole Foods Market, is a member of The Motley Fool's board of directors. Adam Levy owns shares of Amazon. The Motley Fool owns shares of and recommends Amazon. The Motley Fool owns shares of Whole Foods Market. The Motley Fool has a disclosure policy.