This article is the first part of an FT series examining the future of retail

It was on the site of an old Toys ‘R’ Us store in the middle of the pandemic that Amazon launched a renewed assault on the one market that has resisted its rise — and on the one company that can claim to have done as much to shape how Americans shop.

The first Amazon Fresh supermarket opened last September in an upmarket part of Los Angeles. Shoppers encounter an array of in-store tech: trolleys fitted with computer vision monitor the items they pick, while Alexa voice assistants answer questions on every aisle.Since the debut in Woodland Hills, Amazon has added at least a dozen across the US, with several more under construction. Establishing them during a crisis that has forced tens of millions of people to shop online could be dismissed as a curiosity.Instead, it is an acknowledgment by Amazon that it cannot take serious aim at America’s $1.3tn grocery market without the traditional physical retailing it has done so much to disrupt.Amazon’s grocery ambitions will help define the next stage of its more than two-decade battle with Walmart. It comes just as Walmart intensifies its efforts to break Amazon’s dominance of the broader ecommerce market.

“It’s competition for top of mind: what is the place you think of when you think, 'I want to buy a soccer ball, I want a dress, I want ground beef',” Janey Whiteside, Walmart’s chief customer officer, told the Financial Times, without mentioning Amazon. “The retailer that wins that top-of-mind [battle] becomes the go-to destination.”

Amazon and Walmart’s sales have ballooned during the pandemic, making them the world’s two largest public companies in any sector by revenues. Walmart’s remain bigger by a comfortable margin, with net sales last year of $555bn compared with Amazon’s $386bn.

The crisis has encouraged Walmart to more closely integrate its 5,300 US stores and Sam’s Club warehouse outlets with its web operations. One format that has proved popular is kerbside collection, which allows shoppers to pick up goods purchased online, from yoghurts to yoga mats. Digital success is a top priority at its Bentonville headquarters, where executives are convinced that many of the habits that shoppers formed over the past year will stick.

Column chart of Like-for-like quarterly sales growth* (%) showing Walmart

Sharon Rosen, a 58-year-old attorney in Connecticut, said she and her husband were initially “peer pressured” into trying online grocery shopping. They were struck by its convenience.

“You have this extra time in your life because you’re not roaming through the grocery store,” she said, adding the advantages outweighed drawbacks such as not being able to inspect fresh produce.

Rosen is among millions of recent digital converts over whom Walmart and Amazon, alongside other grocery stalwarts such as Kroger and Albertsons, are fighting.

“It’s time for us to dial up our aggressiveness even more,” Walmart chief executive Doug McMillon said at a recent investor day. The scale of the digital transformation was such, he added, that Walmart was “in an early stage of building a new business model”.

Walmart’s multipronged efforts betray an awareness that the pandemic has deepened the upheaval in retail. It has a revamped membership plan to go up against Amazon’s Prime subscription service and expanded its online marketplace, which sells goods from other vendors.Despite sinking billions of dollars into ecommerce — technology is among its biggest areas of capital expenditure, which totalled $10.2bn in 2020 — Walmart remains a digital underdog. It has just 7 per cent of the US ecommerce market next to Amazon’s 40 per cent, according to eMarketer.

Amazon still dominates the US e-commerce market

The company has also made some missteps and Marc Lore, who was put in charge of the group’s US online operations after Walmart bought his digital start-up Jet.com for $3.3bn in 2016, left earlier this year.

The respective market shares underline why Walmart cannot lose to Amazon in grocery, which generates more than half its domestic sales.

“If they’re able to crack the digitisation of grocery, that’s a huge opportunity for them to keep Amazon at bay,” said David Spitz, chief executive of ChannelAdvisor, an ecommerce software company. Whiteside has no doubt that its physical footprint is an advantage. “The fact that we have so many stores is a fundamental strength,” she said, noting that about 90 per cent of Americans live within 10 miles of one.

While grocery is far more dependent on bricks and mortar than other types of retail, the web has made sizeable inroads. The Rosens in Connecticut are far from alone: digital’s share of the market has tripled to 10 per cent over the past year, according to researchers at Mercatus and Incisiv, who predict it will more than double again by 2025.

But even for companies with pockets as deep as Walmart and Amazon, the economics of grocery delivery are daunting.

Walmart offers the service to about 70 per cent of households, yet depending on the option chosen they must spend a minimum of $35 and pay a $7.95 fee — reflecting what Whiteside acknowledged were “challenging” economics, which are even less attractive in America’s suburban sprawl than in denser markets such as the UK.

Whereas orders for general merchandise involve a small number of higher-priced products, grocery baskets typically comprise many low-cost items.Employees must sort through them, a labour-intensive task. Keeping fresh food at the correct temperature in transit adds expense in what is a low-margin business.

Among various experiments to improve the efficiency of “last mile” logistics, Walmart in April invested in a General Motors-backed driverless car company, Cruise.

More conventionally, the addition of millions of general merchandise items to its third-party marketplace could also help margins, as well as drawing more customers. The retailer was trying to make order sizes “as big as possible”, Whiteside said, adding that would make the economics of delivery more attractive.

Ken Murphy, fund manager at Aberdeen Standard Investments, which owns Walmart and Amazon shares, said “there's an awareness that investments have to be made to survive”.“Investors are never excited if margins go down . . . but those companies [the biggest] are the ones that have the capacity to do it. There's increasingly fewer companies able to do it.”

Wall Street has acknowledged that Walmart must plough cash into ecommerce. For years it has given Amazon founder Jeff Bezos plenty of scope to build his empire and worry about profits later.

Although he is to switch roles from chief executive to executive chair later this year, Bezos is expected to remain the dominant voice in what he has described as “one-way door decisions” — strategic moves that are almost irreversible, including the push into grocery.Spearheading it is Stephanie Landry, an Amazon veteran who launched Prime Now grocery delivery back in 2014 and has been involved in Amazon’s previous ventures in food. She will need to learn lessons from them, including Amazon’s $13.4bn purchase of the high-end Whole Foods chain in 2017. The deal alarmed supermarkets, but their fears have not been realised.

One problem was that Whole Foods stores, more compact than a typical Target or Walmart, became clogged as staff picked items for delivery while walk-in customers tried to shop.

The performance of Amazon’s physical outlets has continued to lag behind while online shopping, video streaming and cloud computing have powered ahead. First-quarter results showed the stores’ sales dipped 16 per cent year on year to $3.9bn, while those of the group overall jumped 44 per cent to $108.5bn.

Early in the pandemic, Whole Foods stores were reconfigured to work in much the same way as the Amazon Fresh properties, geared more towards ecommerce. With demand still elevated, Amazon is focusing on how orders can be readied more quickly. It has been expanding a network of Prime Now hubs to deliver groceries directly.

The facilities are smaller than its fulfilment centres, allowing them to be located nearer affluent neighbourhoods whose residents are willing to pay for Prime. There are now 55 such locations across the US, according to logistics analyst Marc Wulfraat.

Line chart of Share prices rebased showing Amazon outperforms wider market

Other initiatives are more customer facing. Amazon recently rolled out a service that allows groceries to be dropped inside garages using smart lock technology.Gizmos in stores, such as the Alexa assistants, also give a high-tech sheen. Success, however, will be determined by something less flashy: whether Amazon can do a better job than Walmart merging the online and physical realms.

The busiest corner of the Woodland Hills supermarket highlights how the sites are a new interface for Amazon.com, bringing the brand closer physically to customers. A help desk attracts a stream of shoppers returning online purchases.

Beyond it lie shelves of bags that await collection by “Flex” drivers — gig workers who will shift the goods to customers within minutes. For now, Amazon’s stores “are too few and too scattered” to have a transformative impact, said Bill Bishop of retail analysts Brick Meets Click. “It would — and potentially will — be a different story if Amazon uses the Fresh stores and Whole Foods to begin to saturate a particular market area.”

Walmart and Amazon face other threats in grocery — not least Instacart, DoorDash and emerging operators in the booming rapid delivery app sector, which has attracted more than $14bn in venture capital over the past year.

Yet the two companies have both consolidated their positions during the pandemic. Their shared grocery ambitions set up what promises to be their most compelling clash yet.