If the enemy of my enemy is my friend, then Instacart may soon have a whole lot of friends.

To be fair, the same-day delivery service isn't quite Amazon's (AMZN 0.17%) enemy -- the two companies actually became inadvertent partners when the online retailer bought Whole Foods. At the time of that deal in mid-June, Whole Foods not only owned a small piece of Instacart but accounted for 10% of its sales.

Amazon buying Whole Foods, however, put the entire grocery industry on notice. The online giant was coming for their customers, and it was going to go after them by offering same-day home delivery -- and not with Instacart, but using its new grocery chain's locations as a base to expand its Amazon Fresh business.

None of this has actually been said by Amazon executives, but it makes sense. Even before it bought Whole Foods, the online retailer had been slowly expanding its grocery delivery business. That forces it rivals to either build their own alternatives or work with a third party. And the clear third party of choice has been Instacart.

An Instacart personal shopper checks out.

Instacart uses personal shoppers to pick your order. Image source: Instacart.

How has this helped Instacart?

Amazon already has the technology infrastructure for same-day delivery. Adding Whole Foods gives it more locations around the country to ship from. That, in theory, should allow it to offer the service in the generally upscale communities that have Whole Foods stores. (Though there may be limitations to what Amazon can do immediately, as Whole Foods' deal with Instacart runs through 2021.

To protect their customer bases and fend off Amazon, the top-five grocery chains in the U.S. -- Kroger, Albertsons, Ahold, Publix, and H-E-B -- have all made deals with Instacart. In addition, the delivery service has expanded its partnership with Costco, works with Target in some markets, and has a deal with CVS.

"Ever since the Amazon-Whole Foods deal happened, things are very different," Instacart CEO Apoorva Mehta told CNBC's Deirdre Bosa. "After that deal happened, we were every major retailer's first call."

How does Instacart work?

Users log into Instacart and enter their address to see if service is available in their area and, if it is, what stores are offered. Assuming you live in a covered area, users then fill their shopping cart from one or multiple stores to be handpicked by a "personal shopper." You can even leave notes on various items, like telling the person doing the picking how ripe you want your bananas.

After you place your order, you then pick a time for delivery, which can be in as little as an hour. Times can fill up and there can be surcharges for busier parts of the day.

Once your order is underway Instacart confirms it via email, and your personal shopper (one per store) will text message you once he or she gets started. In addition, if an item is sold out or otherwise not available, your personal shopper will inquire about replacements or have the item refunded.

Prices are generally in line with what retailers charge in their stores, though Instacart acknowledges that can sometimes be higher on its website. Delivery fees are per store and come in at $5.99 per order of $35 or more or $7.99 if one-hour delivery is available. Orders under $35 cost $9.99 or $11.99 for one-hour delivery. Customers can also add tips.

In addition, Instacart offers a premium Express service for $149 a year. Paying the annual fee gets members free two-hour delivery on all orders over $35, and they do not pay peak time pricing.

Why is Wal-Mart not on board?

Wal-Mart (WMT -0.27%), like Amazon, has the scale needed to build out its own grocery delivery business, though it has been testing using Uber to deliver orders in select markets. Under that system, Wal-Mart employees pick the order, as they do for online orders picked up at its stores, and Uber drivers deliver them.

While Instacart would offer Wal-Mart access to numerous markets all at once, it's likely that the company does not want to be one among many when it can build its own delivery system. That's not really a blow to the same-day delivery company -- not having Amazon or Wal-Mart makes it more attractive to rivals of those companies.

A big three?

It's simply not worth it for most retailers to launch same-day delivery services. Instacart gives them a viable third-party option that has slowly expanded its name recognition. In addition, Instacart is pretty brand agnostic. It displays all the stores in a given area without showing favor to any. That means that consumers would likely remain loyal to the companies they already use, but would perhaps order from new ones in areas not served by their current favorites.

Instacart has been steadily growing and plans to serve 80% of American households by 2018. Assuming it hits that goal, or at least comes close, that makes the service a viable challenger to Amazon and Wal-Mart, as well as an important tool for the rest of America's retailers.