CNBC's Jim Cramer knows what's currently driving the stock market, and it's not earnings, the Federal Reserve, FBI raids, congressional hearings or even price-to-earnings ratios.

"No, it's about China, specifically how well we get along with China," the "Mad Money" host said on Tuesday. "Last night when President Xi [Jinping] spoke in favor of a more open market with lower tariffs on imported cars [and] better intellectual property protection, it was as though he gave us a green light to roar higher."

Combined with President Donald Trump's tweet thanking the Chinese leader for his speech, the seemingly eased tensions sent stocks soaring, with the Dow Jones industrial average surging 429 points, the rising 1.67 percent and the Nasdaq jumping 2.07 percent.

Cramer had a fairly simple explanation for why friendlier rapport between the two presidents helped the market pole-vault: nostalgia.

"Nostalgia for the halcyon days of 2017 when President Trump was on the higher stock price team, when he cared more about the S&P 500 than he did about the steel and aluminum industries," the "Mad Money" host explained.

And while he doesn't think Trump is finished renegotiating trade with the Chinese, Cramer argued that Tuesday's "truce" helped stocks, sending shares of Boeing, Caterpillar and other stocks with China exposure higher.

"As long as the two presidents make nice, I think we could have a couple days of peace until we get to earnings season, which starts on Friday with the banks," Cramer said.

"But peace has a price," he warned. "We need the president to hold back on firing a whole bunch of people like the attorney general, the special prosecutor, the head of the FBI, maybe, or else we're back in the Washington red-hot griddle with our portfolios."

Cramer also acknowledged that not everything in the market hinges on China. Facebook CEO Mark Zuckerberg's testimony before Congress sent the social media giant's stock to two-year highs and took a number of technology names up with it.

"Here's the bottom line: when we look at the world and the stock market, we have to recognize that what matters right now is that the president of China and the president of the United States get along and there will be no war, trade or otherwise," Cramer concluded.

And, although he admitted that market-watchers will soon be swamped with concerns about interest rates and earnings shortfalls, the "Mad Money" host argued that the pent-up demand for stocks remains constant.

"The idea that we could have earnings cut by the government ... is something that no one expected from Trump a few months ago, and today we got a sense that maybe we're back to the joyful days of 2017 when you just bought stocks and watched them go higher," Cramer said.