Read: The Obama Doctrine

“Your article was really long, and so I was printing it while I was working out,” Mattis said. “I got off the machine to read some pages, and I thought I had got some printouts mixed up. I thought I had printed out things that Trump had said, not President Obama.” At the time, Donald Trump was emerging as the probable Republican nominee for president. “I went through it carefully, and I saw that it really was Obama calling our allies ‘free riders.’ He sounded like Trump. Here’s a sitting U.S. president calling our allies ‘free riders.’ That’s pretty bad, insulting our allies.”

My conversation with Mattis that day on the Stanford campus might as well have taken place in a different epoch, or on a different planet. It’s quaint to think that the mild, calibrated criticism Obama directed at a set of allies who probably deserved it could have triggered the outcry it did. And in the spring of 2016, virtually no one in the American national-security establishment had yet imagined that Donald Trump—the target of Mattis’s scorn and derision that day—would become president, and make his task the dismantling of the American idea.

I tell this story because it underscores a salient point: James Mattis understood from the beginning the nature of Trump’s intellectual, ideological, and characterological defects, even as he was pulled into Trump’s orbit, and into his Cabinet.

Mattis, in his retirement years, had built a good life for himself. But when the call came, he chose, one more time, to serve. There is no doubt in my mind that he would have preferred to serve President Hillary Clinton. But patriotic duty is patriotic duty, and he did his, the day he joined Trump’s team. And he did his patriotic duty again on Thursday, when he decided he could take no more.

The critique of Trump contained in Mattis’s extraordinary resignation letter is not centered on policy disputes. He had a set of policy and personnel arguments with Trump, of course. He felt particularly aggrieved by Trump’s decision earlier this month to appoint Army General Mark Milley as the next chairman of the Joint Chiefs of Staff. (General David Goldfein, the Air Force chief of staff, was Mattis’s top choice.)

But the Mattis critique is foundational: The president he serves, he suggests in his letter, does not understand the value of allies, or the immorality of disparaging and abandoning them. Trump, as my colleague David Frum notes, is abandoning America’s Kurdish allies in Syria to extremism and terror, and he is abandoning Afghanistan to the Taliban. Mattis always knew that Trump lacked an understanding of why autocracy is the enemy of the American idea. But Mattis operated under the illusion that he could change Trump’s views, or at least some of his foolish ways. Yesterday marked the end of the illusion.