After CNBC's Jim Cramer watched the stocks of Micron and Macy's spark what amounted to a broad-based rally on Wednesday, he knew he'd have to explain how this odd surge occurred.

Sometimes, the "Mad Money" host explained, big-picture worries about the bond market, rising oil prices or trade talks can sully market performance and put pressure on equities.

"Other times, though, there's a vacuum of information, a real dearth of 'what matters,' like we had today," Cramer said. "In this situation, we can actually care about individual companies and what they have to tell us, provided that these companies are important enough to their sectors that they can give us tremendous pin action," or affect the movements of related stocks.

That's exactly what happened with Micron and Macy's, Cramer argued. Before Wednesday, both stocks were widely disliked. Short positions had built up in both, especially Macy's, he said.

Cramer added that both companies "are total bellwethers" in their respective spaces: Micron because its semiconductors are building blocks in a host of technologies, and Macy's because the brick-and-mortar retailer carries a wide variety of merchandise.

Still, investors were concerned because they saw Micron as beholden to a boom-bust cycle in dynamic random-access memory and flash chips, its flagship products, which are widely viewed as commodities.

But on Wednesday, RBC Capital analysts turned that thesis on its head, issuing a "buy" call on Micron and arguing that the fears were overblown in a note titled "Rationality in Cyclicality."

Sure enough, shares of Micron rallied, spurring positive moves in related stocks like Western Digital, Lam Research, Applied Materials, Texas Instruments, Intel and more.

"The semiconductors are a powerful leadership group, and today they took their rightful place at the front, all because of these [Micron] recommendations," Cramer said.

In the world of retail, Macy's first-quarter earnings report topped analysts' expectations, with accelerating sales and earnings underscoring CEO Jeff Gennette's turnaround plans, Cramer said.

Six days before the report, Morgan Stanley analysts downgraded the stock of Macy's on declining sales and other pressures.

"I've gotta ask: what the heck are they smoking at Morgan Stanley?" Cramer joked.

"Gennette did so much good here, like creating a team of merchants and technology experts that have melded brands with e-commerce and private label to produce some incredible results," the "Mad Money" host continued.

Shares of Macy's surged more than 10 percent in response, boosting shares of brick-and-mortar retailers like Target and Walmart and apparel makers like PVH.

"The bottom line? Micron and Macy's, two companies with nothing in common except that they'd been written off by the naysayers, managed to ignite a rally when we figured today could bring another sell-off," Cramer concluded. "Feels good, doesn't it?"