Though it might seem counterintuitive, all the wrong stocks lead the rally on Thursday—and it made complete sense to Jim Cramer. With crude oil making its biggest one-day move since March 2009, it was strong enough to power a rally in the averages.

So, how the heck can the market rally on higher oil? Cramer explained.

For ages any time Cramer saw mineral and mining stocks jump like they did on Thursday, he always assumed it was related to China. It made sense as the entire commodity bubble in the past decade stemmed from Chinese growth.

Lately, because of the declining growth in China, most investors had given up on commodities. So, does the rally in commodities mean they were premature in giving up on China? Maybe not.

"I think that today's torrid enthusiasm for the commodity stocks will prove to be short-lived because while it's terrific to see that oil has a pulse, the idea that China's prospective demand can somehow reverse the fortunes of crude seems just plain fanciful to me," the "Mad Money" host said.

Lucas Jackson | Reuters

Traders work on the floor of the New York Stock Exchange.

"Today though, when I see the commodities rally, when I see oil lift, that tells me we've got some breathing room"-Jim Cramer

But anything that shows that oil can go higher gave hope to the traders in fixed income that there will not be a collapse of the some $200 billion in bonds that oil companies have taken out to finance drilling. That was the heart of Thursday's move.

The reaffirmed confidence in the credit market encouraged some money managers to step up to the plate and buy all sorts of stocks, not just oil and mineral names.

This made complete sense to Cramer, because investors have often expressed concern to him that they think there is some sort of major event lurking in the commodities markets. They had feared that there was a bad company out there that could do some real damage, and Cramer started to believe it, too.

"Today though, when I see the commodities rally, when I see oil lift, that tells me we've got some breathing room," Cramer said. (Tweet This)

That means whoever could be in trouble out there due to the falling price of commodities now has a chance to raise money, make some sales, reposition and avoid catastrophe. Cramer thinks that Thursday's rally was more about doomsday avoidance than anything else.

But perhaps best of all, Cramer saw an establishment of a new pattern in the market where buyers emerge at the end of the day because they are afraid to miss something good. A good change!

"The strength in the commodity complex was capable of powering the vast bulk of this market higher, even stocks that should go lower when oil goes higher, because the commodity rally potentially eliminates some dastardly big bad event that we can't see or feel, but we know could be out there lurking," Cramer said.

It was a very nice breather and may have just taken big risk off the table.