“WE know the economy will be a critical factor this year,” said Lee Scott, the boss of Wal-Mart, as the world's biggest retailer released its quarterly results on February 19th. Wal-Mart's prospects do indeed reflect those of the economy at large—but not in the way you might expect. With America tipping towards recession, Wal-Mart is doing much better than in the past couple of years when the economy was booming. Sales increased by 8.3% compared with the same period last year, to a record $106.3 billion. Mr Scott concluded that in a volatile economy Wal-Mart was “well positioned to succeed”.

The secret of Wal-Mart's meteoric rise over the past five decades has been its obsession with low prices. It got into trouble in 2005-07 when it focused less on “always low prices” (its longstanding motto) and more on expansion. Sales growth, productivity and profits fell, while Target and other upmarket rivals snatched market share. Wal-Mart, the biggest private employer, became a favourite public whipping boy because of its health-care, gender and labour policies. In February last year Mr Scott's job was said to be on the line.

“We used to be quite negative on the stock, because the company threw too much money at new stores,” says Gregory Melich, a retail analyst at Morgan Stanley, an investment bank. Wal-Mart has over 7,100 stores worldwide and more than 4,000 in America. Last summer Mr Melich upgraded his verdict on Wal-Mart, because he saw a “big strategic shift”: it reduced its capital expenditure to $14 billion for the fiscal year, from $18 billion the year before, slowing its expansion to spruce up existing shops instead. It opened far fewer new shops in January than in previous years.

The economic downturn is another boost for the recovery of the Bentonville behemoth, as cost-conscious consumers defect (or return) to the cheapest of the big retailers. Prices for oil and many foods are at record highs, but Wal-Mart can pass some inflation on to shoppers without losing its low-price leadership. And it is in the right line of business in hard times. Its biggest strength is grocery sales, which are not slowing down, and are unlikely to, since they are essential purchases.

Other retailers are in a far harder spot. Home Depot, America's number two retailer, is in its sixth quarter of falling sales. The home-improvement market has been badly hit by the subprime-mortgage meltdown. Fashion retailers are in trouble, since most people think they can put off buying clothes. Ann Taylor, a fashion retailer, says it will close 117 of its 921 stores over the next three years.

Even so, analysts predict that overall, retailing will escape a recession this year. They forecast 3% growth (excluding cars and petrol) compared with 4% last year. Retailers with international reach gain from the weak dollar. Wal-Mart's operations abroad, which represent one-quarter of sales, grew by 18.8% in the past three months. The American government's fiscal-stimulus package of up to $168 billion will give retailers an extra $15 billion or so, and Wal-Mart is likely to get the lion's share. In tune with the times, the firm with always low prices changed its slogan last year to a new variation on the theme: “Save money. Live better.”