Walmart's (NYSE:WMT) second-quarter earnings report last week shows just how important online grocery shopping is becoming for the retail behemoth, as U.S. sales and same-store sales grew during the period because of it.

CEO Doug McMillon told analysts on the earnings conference call, "As we scaled grocery pickup in the U.S., it unlocked new capabilities like grocery delivery." 

He pointed out that Walmart is attacking groceries from every direction, with the retailer not only offering its vaunted buy online, pickup in store service, but also pickup towers and lockers; a new InHome delivery program launching this fall where delivery employees will put your perishable groceries away in the refrigerator for you; free one-day delivery for orders over $35; and now its newest option, unlimited grocery delivery service where orders over $30 will be delivered for $98 a year.

There is an option for just about every kind of customer, but unlimited delivery looks like the new battleground.

Man delivering groceries

Image source: Getty Images.

Everyone's doing it (NASDAQ:AMZN), of course, would seem to be the main target. Its Prime loyalty program costs $119 a year and includes free grocery delivery for members, but Target (NYSE:TGT) recently acquired Shipt and began a new delivery service for $99 a year, while Instacart, one of the established grocery delivery leaders, slashed its annual feel last year from $149 to $99.

Making online grocery purchases a no-brainer where the customer doesn't have to consider the penalty a delivery fee adds to the order is the end goal. Groceries are already the fastest-growing segment of e-commerce, and they are expected to grow 18% this year to almost $20 billion.

Amazon is the largest player, but Walmart, Target, and Kroger (NYSE:KR) are using their physical store assets to accelerate sales. Kroger, in fact, saw online grocery sales surge 66% last year, allowing it to leapfrog over Ahold Delhaize, which operates the Giant and Stop & Shop supermarket chains, to place third behind Walmart.

Giving consumers options on how much they want to pay to have their groceries delivered will attract more customers to the various platforms. Target's Shipt had the annual subscription fee in place already, but also recently added a $10-per-order option. Walmart is going in the opposite direction, adding unlimited delivery for an annual fee to supplement its existing $10-per-order delivery service fee.

But it's a costly service

Yet there are risks to the retailers, too. Last-mile delivery is the most expensive leg of the trip, making it harder for retailers to make a profit on the service. Recode recently suggested Walmart is set to lose $1 billion this year on its e-commerce operations -- which obviously includes more than just groceries -- but retailers have been experiencing rising freight and transportation costs, and increasing the usage of online grocery delivery won't alleviate the pressure.

Amazon also faces substantial costs in delivering goods, spending upwards of $28 billion globally last year on shipping. While pricing their grocery options below Amazon Prime's threshold seemingly gives its competitors a pricing edge, there are a lot of other benefits included in the e-tailer's loyalty program.

And just as Amazon had to increase the annual fee by $20 to try to recoup some of the expenses it has for delivery, Walmart and others may find they will also need to raise their rates.

Frequent online shoppers will find an annual plan economical, as fill-in shopping (shopping that is higher-value than quick trips to the store for single, necessary items but not as valuable as routine trips to the store) is by far the most common way consumers buy groceries today and also the most frequent way people shop. However, it could place a bigger toll on the services as they grow in popularity.

A growth driver

Walmart has invested heavily in its online grocery business and it is paying off with rising sales. The e-commerce portion of its business rose 37% in the second quarter while increasing the number of monthly users. McMillion told analysts, "We've quickly grown this piece of the business in recent years, and I know we can do even more as we look ahead."

With 90% of the U.S. population living within 10 miles of a Walmart store, unlimited grocery delivery could be a big service for the retailer -- and one many consumers will likely think is worth paying for.

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.