What happened

Shares of retail stocks were soaring across the board Monday. The unloved sector seemed to benefit from a massive rotation in the market as investors moved out of high-priced tech and cloud stocks like OktaShopify, and Fastly and into low-priced value plays in the retail and energy sectors.

Though the retail sector has been sensitive to trade-related news in recent days, there did not seem to be any specific news driving industry stocks higher. Instead, the market seemed to think that the gap between expensive and cheap stocks had simply gotten too big, and sold high-growth stocks that have generated big returns for struggling value plays that have struggled in retail and elsewhere.

The industry-tracking fund SPDR S&P Retail ETF (NYSEMKT:XRT) finished the day up 3.5%. Among the individual winners in the sector were Michaels Companies (NASDAQ:MIK), up 16.5%; GameStop (NYSE:GME), which gained 10.7%; J.C. Penney (NYSE:JCP), up 11.8%; Signet Jewelers , which finished up 11%; and Tailored Brands. A number of big-name retailers, including department-store chains Macy'sNordstrom, and Kohl's finished up more than 5%.

A blurred image of dozens of shoppers moving up and down the escalator

Image source: Getty Images.

So what 

With market rotations like this, there often isn't a clear cause. Investors sense that one sector is overpriced and another underpriced, and a trickle from one to another turns into a rush.

That seems to be the best explanation for what's happened, as investors bailed on high-priced tech stocks that have soared this year and plucked up dirt cheap value stocks. A look at some of the metrics of Monday's retail winners may explain why the market took a shine to them, as many of them are still solidly profitable despite having fallen out of favor with investors.

For example, arts-and-crafts retailer Michaels is trading at a P/E ratio of just 4.5 after Monday's surge. By contrast, many of the cloud-computing stocks that were diving are trading at price-to-sales multiples of more than 20.

For a stock as cheap as Michaels, the company is doing better than you might expect. The business looked sound in its second quarter, with comparable sales ticking up 0.3% and earnings per share jumping 26% to $0.19 as the company continues to aggressively repurchase shares on the cheap.

Not every retail gainer Monday is in the same shape as Michaels. J.C. Penney, for instance, has largely been written off by the market, and the department store chain was recently given a delisting warning by the New York Stock Exchange, as its share price has fallen below $1. Comparable sales have been plunging, and the company faces a $4 billion debt burden. Turning around the business at this point may be almost impossible.

Similarly, GameStop stock has plunged as its entire business model -- selling video games in stores -- has become obsolete. These days many games don't require separate cartridges, and you can easily order the ones that do online. In its first-quarter earnings report, the company's comparable sales fell 10.3%, driving overall revenue down 13.3%. The company will report second-quarter earnings tomorrow.

For struggling retailers like J.C. Penney and GameStop, these gains may be more of a reflection that the stocks had fallen too much, rather than a vote of confidence that they offer long-term value at their current prices.

Now what 

Like beauty, value is in the eye of the beholder. Whether or not the retail sector or individual retail stocks are good values is up to the market and individual investors. It is clear, however, that many of these stocks generate solid profits, offer huge dividend yields, and are priced lower than almost ever before. The market is fully aware of the changes in the industry and the threat from e-commerce, but it's a good bet that at least some of these stocks are now undervalued.

Ultimately, though, the winners won't be determined by a single-day market rotation. They will have to prove themselves on the field, and put up the numbers to justify any recovery in their valuations. With the holiday season just a couple of months away, the next few months could be crucial for many of the retailers listed above.