Wal-Mart (NYSE:WMT) stock has gone on a mini-slump since it became public that Amazon.com (NASDAQ:AMZN) planned to buy Whole Foods (NASDAQ:WFM).

That news sent many supermarket and grocery-chain stocks moving in the wrong direction. Basically, the market assumes that Amazon will be able to take a bigger piece of the grocery pie by integrating its technology and customer base with Whole Foods' brick-and-mortar business.

It's very possible that will happen. Amazon has buying power that surpasses all but its largest rivals. Smaller supermarket chains may well lose customers to whatever in-store and delivery options the online leader brings to Whole Foods.

Wal-Mart, however, has less to fear. The company has more than 5,000 locations in the United States, dwarfing Whole Foods' 400 or so. It also has a growing digital business, as well as the purchasing power to meet or beat Amazon's prices and the cash to compete with its efforts at innovation.

WMT Chart

Image source: YCharts.

Why is Wal-Mart a buy?

Wal-Mart shares closed at $78.91 on June 15, the day before the Amazon/Whole Foods deal was announced. They sank to $75.24 at close on June 16, and shares were trading around that range, settling in at $75.33 at market close on July 7.

That's not a huge drop -- some chains fell much farther -- but it shows that at least some investors believe Amazon's purchase of Whole Foods changes things for Wal-Mart. It's easy to see why someone would have that knee-jerk reaction, but in the long run it's hard to see how this deal will have a major impact on Wal-Mart.

A Wal-Mart worker in the produce section

Wal-Mart and Amazon already compete in the grocery space. Image source: Wal-Mart.

It's a lot of conjecture

Amazon may use its purchasing power to lower prices at Whole Foods. It may also use the supermarket chain's stores and warehouses to enhance its own efforts at same-day grocery delivery. In theory, the online retailer could make every Whole Foods a hub for drones, and a base for faster delivery.

Wal-Mart can do all of those things as well, and from a much larger store base. In fact, the company already has an edge in that area, as it's been aggressively testing pushing customers to order online but pick up in stores.

Amazon could change Whole Foods and introduce some of its house brands while bringing overall prices down. It could even use the chain for delivery under the Amazon Prime brand name, allowing it to offer a value play without compromising the Whole Foods brand.

What Amazon almost certainly won't do is take the upscale grocery chain and make it a downmarket, price-based competitor. The online retailer may go cheaper, but it's not going to sacrifice the premier brand it has purchased.

What will happen?

Wal-Mart and Amazon are competitors fighting for some of the same customers. Their battle, however, will be a lot like when Godzilla faces Mothra or some other giant monster. The two companies will pummel each other, but the real damage will be done to lesser players in the space.

Even if the two giants target each other, it's more likely they'll gain share from regional supermarket chains that won't have the resources to match prices or technology. Amazon is encroaching on Wal-Mart's brick-and-mortar stronghold, but that's happening at the same time the physical retailer has upped its digital game.

Sales will shift, battles will be fought, and there will be losers in the grocery/supermarket space as Amazon takes over Whole Foods. Expecting Wal-Mart to be one of those losers is unrealistic. The company will have to respond and react to whatever Amazon does, but the same is already true in reverse.

Wal-Mart shares are down because of Amazon's purchase of Whole Foods, but they will recover. That creates a buying opportunity for people who believe that the retailer can protect its brick-and-mortar business while continuing to grow its online business. Those are both things Wal-Mart has been successful in doing, with online growth being spectacular at 63% in the most-recent quarter and same-store sales growing for 11 straight quarters.

The pairing of Amazon and Whole Foods is a game changer, but it doesn't really change the game for Wal-Mart. Both companies should be able to continue to grow taking share from smaller rivals that simply won't be able to keep up.

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.