The retail industry has experienced massive upheaval over the past two years. In 2020, the COVID-19 pandemic crushed retail traffic and forced many retailers to temporarily close their stores. And while demand has bounced back in 2021, retailers have had to contend with labor shortages, surging freight costs, and severe supply-chain disruptions.

Through it all, TJX Companies (TJX 0.14%) has stood strong. On Wednesday, the off-price retail giant reported another big earnings beat. That sent TJX stock soaring 11% to a record high of $76.92, before eventually ending the day with a solid 6% gain.

Lots of handwringing

U.S. retailers have benefited from red-hot demand throughout 2021. Through the first 10 months of the year, retail sales jumped 18.4%, according to Census Bureau statistics. That enabled TJX to deliver excellent results in the first half of the year. Comparable sales jumped 16% compared to two years earlier in the first quarter and soared 20% in the second quarter, leading to big earnings beats each time.

Nevertheless, as of a week ago, TJX stock was flat for the year, trailing the market by a wide margin.

TJX Chart

TJX stock performance, data by YCharts.

Investors appeared to have a slew of concerns. Perhaps rising freight and labor costs would crimp profits. Perhaps consumer spending would cool off due to inflation fears and the end of various government stimulus programs.

Most notably, many investors worried that tight retail inventories across the industry would make it hard for TJX to get products for its stores. Indeed, some feared that the retail industry would keep inventories lower permanently, reducing the availability of discounted goods for off-price retailers going forward.

Another excellent quarter

Investors had no reason to worry. For the third quarter of its 2022 fiscal year, TJX recorded a 14% comp-sales increase, compared to two years ago, led by a 34% gain for the HomeGoods unit. Total sales rose 20% over the same period, reaching $12.5 billion, about 2% ahead of the analyst consensus.

TJX also managed to increase its pre-tax margin by 0.3 percentage points relative to fiscal 2020 (i.e., two years ago). Strong merchandise margins -- driven by high demand and tame competition -- more than offset elevated freight costs, rising labor costs, and pandemic-related expenses.

As a result, earnings per share (EPS) grew 24% over TJX's Q3 results in fiscal 2020, reaching $0.84. On average, analysts had expected EPS of $0.81. With earnings trends continuing to improve, TJX raised its full-year share-buyback plans by $500 million.

A woman pushing a full shopping cart outside a Marshalls store.

Image source: TJX Companies.

Momentum set to continue

In recent years, TJX has periodically reminded investors that it has never struggled to get enough merchandise. The company has over 1,100 buyers and relationships with tens of thousands of vendors, giving it plenty of options for stocking its stores. Moreover, tight inventory has led department stores to radically cut back on discounting this year, giving TJX room to pay more for its inventory and charge a bit more than usual, while still providing great value, compared to other retailers.

Sure enough, on Wednesday, the off-price retailer brushed away all of the worries about its ability to get inventory for the holiday season. TJX exited October with more inventory than it had at the same time two years ago. It added that most of its holiday inventory has already been delivered or will arrive very soon.

Meanwhile, the company's strong year-to-date sales trends have continued to start the fourth quarter. Management disclosed that TJX has logged mid-teens comp-sales gains in the first half of November, in line with its Q3 growth trend.

Even after rising 6% on Wednesday, TJX stock trades for just 22 times forward earnings. Considering the retailer's deep moat and long-term growth opportunities, that valuation leaves substantial upside for TJX shares over the next few years.