Apple's second-quarter earnings beat on Tuesday illustrated just how differently this company's stock behaves compared with the rest of the market, CNBC's Jim Cramer said.

"The bane of this market is not tariffs or interest rates or inflation; no, the real killer is great expectations," the "Mad Money" host said on Tuesday. "Apple is truly the vast exception to the rule."

Ahead of the iPhone maker's earnings report, analysts had effectively eviscerated the estimates with downbeat supplier surveys and doom-spelling notes about weak China sales, Cramer said.

But after Tuesday's closing bell, the largest company in the world proved them wrong.

"The company sold more iPhones than most of the bullish analysts thought, including the X, which the community had derided endlessly," Cramer said after he and CNBC's Josh Lipton spoke with Apple CEO Tim Cook.

"The service revenue, bolstered by 100 million new customers year over year – bringing paying members to 270 million – accelerated dramatically, and the expected big guide-down didn't occur, even if the rumored $400 billion buyback didn't occur, either," Cramer continued.

On the call, Cook echoed these sentiments, touting the success of the iPhone X, which many had written off due to its near-$1,000 price tag.

"[The] iPhone X was the most popular iPhone each and every week of the quarter," Cook told Cramer and Lipton. "It was also the most popular iPhone every week since its launch. So, the iPhone X has been a huge success and it's the first time, since we split the lineup back at iPhone 6 and iPhone 6 Plus, that the top model has been the top-selling model. That's unprecedented in that history."

Cook also spoke to the strength of Apple's sales in China, shrugging off negative estimates that had emerged ahead of the quarter.

"In terms of geographies, Greater China grew 21 percent, which was our best growth rate in Greater China in two and a half years. So we are incredibly proud of that," the CEO said.

And, when asked about the impact of potential trade war escalation, Cook seemed surprisingly sanguine about the state of U.S.-China relations.

"I am pretty optimistic there," Cook told CNBC. "I think that China and the U.S. have this unavoidable mutuality where the U.S. can only win if China wins, China can only win if U.S. wins and the world can only win if both win."

"So if you look at what history tells us — that countries that are the most open and most diverse do the best, and the folks that are closed and least diverse, their citizens do the worst — ... it tells us that again and again and again," Cook continued. "And I think both countries know that."

Read the full transcript of Cook's interview here.

So, in a market where analyst sentiment going into the quarter can seem way too grim — or, conversely, way too optimistic — Cramer asked investors to remain cautious and do their own homework.

"[Apple's] estimates and any enthusiasm that had once been generated by the largest company in the world had long since diminished," he said. "For the vast majority of stocks, though, it's quite the opposite. I'm saying that Apple is the outlier. Many stocks have kind of just been set up for disappointment because, totally unlike Apple, there's been endless number bumps but, more importantly, endless upgrades."