After years of rapacious store growth, Wal-Mart Stores (WMT 1.46%) is turning to a new idea for building sales -- online grocery pick-up.  The program, which allows customers to order groceries online and pick them up at a dedicated station in the parking lot, has been in testing for two years; Wal-Mart expanded it to a number of new markets last fall, including Atlanta, Nashville, Tucson, and Colorado Springs.

The move comes as Wal-Mart has been losing share to rivals like Kroger (KR -0.38%) and Costco Wholesale (COST -0.02%), which have put up consistently strong comparable sales growth numbers while Wal-Mart's have been nearly flat.

Historically, Wal-Mart had a simple formula for increasing sales -- opening new stores and converting discount stores, locations without a grocery department, to supercenters, which included the trappings of a supermarket. However, that strategy seems to be approaching its natural end. 

Wal-Mart's real estate growth is a far cry from where it was a decade ago. In the company's go-go pre-recession years when overall percentage sales growth was in the teens, its U.S. footprint was expanding consistently by 8-9%. This year, it's set to grow by just 1.5%.

That slowdown has come as the company has saturated much of the country with its supercenters, and as competition from (AMZN -1.86%) has threatened its competitive advantages built on low-cost leadership and the convenience of a wide selection. Building new stores won't protect Wal-Mart from Amazon, which is why the company has been gradually shifting investment dollars to e-commerce rather than building physical stores. 

Why grocery is so important
Founded in 1962, Wal-Mart's roots are as a discount emporium, not a supermarket chain. Recognizing the opportunity in groceries, the company opened its first Supercenter -- a combined discount store and supermarket -- in 1988, and rapidly expanded the concept through the 1990s and 2000s, adding new Supercenters and converting discount stores. By fiscal 2005 it had more Supercenters than discount stores, and today it has less than 500 discount stores and more than 3,000 Supercenters nationwide. 

In other words, groceries fueled much of its domestic growth during its heady expansion years in the 1990s and 2000s. From 2008 to 2015, grocery sales at Wal-Mart's U.S. division have contributed 100.4% of its sales growth, or $48.7 billion worth, increasing its share of overall revenue from 47% to 56%.  

While Wal-Mart is known for selling virutally everything, including electronics, apparel, and furniture, those categories have remained flat altogether in recent years. When it comes to growth, groceries are the only category that matters.

Shifting strategies
It's clear why groceries are so important to Wal-Mart, but examining the company's past strategies will help explain why it is turning to online grocery pick-up.

In recent years, Wal-Mart's three drivers for growing grocery sales have been opening Supercenters, opening Neighborhood Markets -- smaller-format stores that have a limited selection of non-groceries -- and converting discount stores to Supercenters.  At their peak, Wal-Mart's discount stores numbered nearly 2,000 nationwide; however the vast majority have already been converted to Supercenters, leaving that opportunity mostly tapped out. Neighborhood Markets looked like a promising growth avenue a few years ago. The segment has consistently delivered high-single-digit comparable sales growth, and in fiscal 2015 the company added 235 of the grocery stores, touting its success. However, last year that number shrank to under 170, and the retailer only expects to open 85-95 Neighborhood Markets in the current year. Supercenter expansion has also slowed dramatically as the company plans to add just 50-60 this year, down from more than 100 in 2011-2015. Competitive threats along with a decision to invest in current assets and e-commerce seem to be the reason why new store expansion has slowed.

All bets are on grocery pick-up
The company's newest idea for increasing grocery sales is its new online grocery pick-up service. Launched last year, the program allows customers to order online and then pick up groceries in as little as two hours at no additional charge. Some markets also allow for delivery.

Source: Walmart

According to the company, the program is overwhelmingly popular: users rate it 4 or 5 stars, and 85% are repeat customers.

With the program only available in a small minority of Wal-Mart stores, it won't move the needle on sales until it's expanded significantly. However, in addition to winning over customers, it also offers protection from Amazon and Costco. Amazon has struggled to scale up its own AmazonFresh delivery service as the logistics of transporting delivering groceries have proven difficult, while Costco, with its warehousing model, says it prefers to get people in the store rather than sell through the online channel.

Groceries are one of the few retail categories in which Wal-Mart's massive store base gives it an advantage. As the company slows down its store expansion and runs out of discount stores to convert, grocery pick-up seems like its best bet for continued growth.