At a price-to-earnings ratio of roughly 43 times, Walmart (NASDAQ: WMT) is trading well above its 10-year historical average of 32 times earnings.

That premium is drawing scrutiny at a moment when investors are scrambling for shelter from a deepening technology sector sell-off that has rattled broader markets.

Shares have climbed 9% since September 30, lifting Walmart’s year-to-date gain to 13% after the stock suffered a notable pullback over the summer months.

The move looks like a classic flight-to-safety rotation, with investors gravitating toward consumer staples names as volatility in high-growth technology stocks intensifies.

Walmart has a well-documented history of holding up during market stress, giving the rotation at least some historical foundation to stand on.

During the 2008 financial crisis, Walmart stock actually gained 18% in a year when the S&P 500 lost 38% and the Nasdaq dropped 40%.

The pattern repeated in 2002, when the S&P 500 shed 23% and the Nasdaq fell 31%, while Walmart managed to limit its own decline to just 12%.

Beyond its defensive track record, the retailer has also been gaining ground competitively, winning market share from Target, particularly among higher-income shoppers who have gravitated toward its lower price points.

The combination of defensive credentials and competitive momentum has made Walmart a go-to name for risk-averse investors, but the current valuation complicates that narrative considerably.

Trading at a multiple that mirrors the kind of premium typically associated with growth-oriented technology companies, Walmart may not offer the margin of safety its reputation implies.

As one analyst framed it, Walmart “has many attributes that should allow it to perform well in a downturn, but like many tech stocks, it’s overvalued right now,” adding that for that reason they “wouldn’t call it the safest to own if things get worse.”

Whether investors piling into the stock during October’s tech turbulence are making a sound defensive bet or simply chasing a crowded trade at an uncomfortable price remains an open and consequential question.