With the stock market in a party mood even ahead of a potential “Santa Claus Rally,” some investors are concerned about the quality of gifts they are getting. They can probably relax.

As far back as 1972, the famed Stock Trader’s Almanac identified the period spanning the last five trading days of one year and the first two of the next as particularly favorable for equities. The S&P 500 has gained during this Santa Claus Rally for the past seven years. Friday marks the start for 2023.

This time, though, stocks have already done well in the run-up to Christmas. Analysts have pointed to striking gains at low-quality companies, “meme” stocks, cryptocurrency-related ventures and blank-check vehicles as signs of a “dash for trash.”

Shares in Reddit darling GameStop have gained 29% since the current rally started on Oct. 30. Carvana, an online used-car seller popular during the pandemic, is up 104%. The 20 most shorted U.S. stocks, as identified by S3 Partners at the end of September, have risen 21%, outpacing the S&P 500. In general, shares in firms with fragile balance sheets have done better than average.

Step back, though, and the recent upswing in stocks doesn’t need to look so trashy.

For one, investors’ appetite for out-of-favor stocks is relatively new. This rally has had two phases. The first was led by the “Magnificent Seven” tech giants—Apple, Microsoft, Alphabet, Amazon.com, Nvidia, Tesla and Meta Platforms—and lasted until Nov. 29. During this period, smaller-capitalization and discounted “value” companies severely underperformed the market.

Even in the weeks since Nov. 29, “quality” stocks have only slightly lagged behind. Within the broad Stoxx USA Total Market index, those companies with low Altman Z-scores—a metric of balance-sheet robustness—have done better than average. But the trend is concentrated in a handful of distressed businesses. For the majority of the equity market, the correlation between performance and balance-sheet problems has been weak.

So, yes, some firms with negative Z-scores have benefited from 2021-style speculative bets on bad businesses, including “meme-investor” favorites such as Nikola, Beyond Meat, Wheels Up and Virgin Galactic. Retail traders have stepped up purchases, according to VandaTrack data. Still, the gains in such shares only look large because they had fallen so far. Their rebound is insignificant in a longer-term context.

Overall, it looks less like investors are becoming overly giddy and more like the rally is broadening, having previously attracted criticism for being too concentrated at the top of the market. As fears of a recession triggered by higher interest rates have faded, particularly in the U.S., investors have taken another look at medium and small caps. Some of these had been trading at extremely low valuations ever since the pandemic.

Smaller doesn’t always mean trashier. Even the highest-quality constituents of the S&P SmallCap 600 index have gained about 11% since Nov. 29, compared with 13% for the index overall and 4.3% for the S&P 500.

The recent rally raises questions even if it isn’t as risky as it first appears. One is how much of an extra Santa Claus bump there can be. A reason that researchers have given for the trading phenomenon is the tendency of some investors to sell their losers earlier in December for tax purposes, prompting others to buy them at discounted prices later in the month. But these laggards have done so well lately that there may be no year-end bargain hunting left.

Another question is which stocks will lead the market after Christmas. Nothing stands out as offering much value: Quality stocks such as the Magnificent Seven haven’t really gotten cheaper, while the sectors that have caught up with tech over the past month still yield less in earnings than investment-grade bonds do in coupons.

Given the doubts ahead, investors shouldn’t look too unfavorably at the presents they have already been given.

Write to Jon Sindreu at jon.sindreu@wsj.com