 Bloomberg -- Walmart Inc. shoppers are a pretty loyal bunch. But when virus-spooked Americans began avoiding stores earlier this year and shifting spending online, far more Walmart customers went to Amazon.com Inc. than Walmart.com.So even though Walmart, too, has thrived as an essential service amid the pandemic, Amazon is benefiting more.In the first week of February, for every dollar shoppers spent with the two rivals, 66 cents went to Walmart and 34 cents to Amazon, according to Facteus, which tracks credit and debit-card spending for millions of shoppers. In the first week of August, that gap narrowed to 55 cents to Walmart and 45 cents to Amazon. Walmart, through a spokesman, declined to comment.When the coronavirus began spreading across the the U.S., Amazon stumbled at first. Shipping times lengthened; multiple products were out of stock. Some reports said the companys vaunted customer service metrics were starting to slip. Amazon responded by hiring 175,000 people to keep its operations running as existing employees sickened or stayed away for fear of catching Covid-19.The strategy, which included stepped-up safety measures in warehouses, eased investors fears. But few predicted the second-quarter earnings report that shattered Wall Streets already optimistic expectations and forecast a continued surge in demand even as stores start to re-open. The shares have advanced more than 65 this year, compared with a 3 gain for the SP 500.Turns out the online retail giant was perfectly situated to take advantage of a sudden shift in consumer behavior that, according to McKinsey, has compressed 10 years worth of online sales growth into three months. Amazons easily searchable website packed with hundreds of millions of products that can be delivered from warehouses scattered across the country stood out more than ever when the malls and Main Street went dark. And shoppers suddenly became quite forgiving of delivery delays. More than 8 in 10 thought holdups of a few days or longer were reasonable given the outbreak, according to a survey of 500 Amazon consumers conducted in June by Minneapolis, Minnesota-based Goat Consulting.As always, consumers are mostly mission-shopping at Amazonhitting the site with a list that now includes everything from hand wipes and masks to above-ground pools and home-office furniture. But another trend has emerged too. People who once trolled the mall with no particular product in mind are starting to do the same on Amazon, which hasnt previously been known for window shopping. Consider the surge in demand for shelves shaped like coffins and gigantic stuffed panthersclassic retail therapy for a panicked populace.Rather than price-compare or look for alternatives, a large portion of the U.S. populationas well as in other core Amazon marketsdefaulted to Amazon, says Juozas Kaziukenas, founder of Marketplace Pulse, a New York research firm that monitors the site. They were able to default to Amazon because of its vast selection, so even as people went from shopping for masks to toilet paper to webcams to dumbbells to inflatable pools and back, Amazon had it. Its not that other retailers didnt have the same products at similar prices. The key was that customers didnt look elsewhere.Of course, other retailers allowed to stay open throughout the pandemic have benefited, too. Walmart, Target Corp. and Costco Wholesale Corp. have all gobbled up sales lost by shuttered stores, allowing them to grow even when consumers cut overall spending in response to rising joblessness and a tenuous economy. But Amazon has outperformed them all. Its website attracted 2.57 billion visitors in July, more than EBay Inc., Walmart, Etsy, Home Depot, Target and Best Buy combined, according to Marketplace Pulse.Amazon has become a substitute for entire industries. Foodies turned to it for new kitchen appliances after their favorite restaurants closed. Hair dye sales surged because people couldnt go to salons. Many Americans are finally starting that garden since they have nothing else to do. All of these factors combined to propel second-quarter sales 40 to 88.9 billion.The big question for investors is whether Amazons sales spike will endure. The economy is still struggling, and it doesnt help that Congress is deadlocked on a fresh round of stimulus spending and an extension of unemployment benefits. Theres also little doubt that some of the buying on Amazon and elsewhere is related to the pandemic and could fade. In a survey of 1,000 U.S. shoppers conducted last week, more than half said theyve made online purchases as a way to relieve stress, says Vivek Pandya, Senior Digital Insights Manager at Adobe Digital Insights.That could explain the strong demand for those coffin-shaped shelves, which are sold as a kind of gag by Helium 10, an Irvine, California-based company that makes e-commerce tools. Ditto for the spike in sales of giant stuffed animals. Whether people are just looking for something large and comforting during these uncertain times or theyre just bored and think a giant panther would look good in that empty space in their living room, I dont know, says Macy Frazier, an operations analyst at Viahart, the Canton, Texas-based merchant that sells them. Theres just something going on.Retail therapy exists in good times as well as bad. And when the pandemic ends, Amazon will inherit a landscape decimated by dozens of retail bankruptcies, including department store chain J.C. Penney Co., clothing retailer Lord Taylor, furniture and housewares seller Pier 1 Imports Inc. and Modells Sporting Goods Inc. Its tellingand a potentially ominous sign for these retailersthat Amazons subscription services surged 30 last quarter. Most of that is new Prime members, who will be hard to dislodge once the battered chains emerge from Chapter 11 with fewer stores.For more articles like this, please visit us at bloomberg.comSubscribe now to stay ahead with the most trusted business news source.2020 Bloomberg L.P. 