Trump has dramatically shaken up up his frontline national security team just days after announcing a potentially groundbreaking diplomatic overture to North Korea. On Tuesday morning, the president unceremoniously dumped long-suffering Secretary of State Rex Tillerson (who reportedly learned of his ouster via Trump's tweet), replacing him with loyal CIA Director Mike Pompeo. Trump is also promoting Gina Haspel, the CIA's deputy director, to lead the agency. She would be the first woman to helm the 70-year-old spy agency. Both positions are subject to Senate confirmation, but both Pompeo and Haspel are likely to be confirmed (although Pompeo's hearings might be a little rockier).

But the question begs: Why is Tillerson out? What caused this massive national security shakeup?

You can see it all in the president's praise of Pompeo: "Tremendous energy, tremendous intellect. We're always on the same wavelength. The relationship has been very good, and that's what I need from a secretary of state."

We're always on the same wavelength. This is key. From day one, Pompeo's refusal to break publicly with Trump, his willingness to vouch for his boss' often-maligned intelligence and credibility, and his corralling of the forces of the CIA's part of the "deep state" have given Trump pause to wonder whether Pompeo, who briefs Trump daily and sees him more often than Tillerson did, wouldn't be better as his chief diplomat.

Pompeo is Trump's kind of guy. He'll defend his boss no matter what. That sort of unquestioning loyalty has always been absolutely critical to Trump.

Tillerson, of course, hardly fit that mold.

The former ExxonMobil CEO famously called the president a "moron" after a meeting last summer — and then didn't really deny it. He has since spent the better part of the past six months playing a very small role in Trump's ego-centered policy process, Tillerson came to disagree with the president on matters large and small. As but one example, mere hours before his firing, Tillerson seemed to break with the president by blaming Russia for a nerve gas attack in England. ("White House Press Secretary Sarah Huckabee Sanders had repeatedly declined to blame Russia for the nerve gas attack," as my colleague Peter Weber pointedly notes.)

Such things hardly escaped Trump's notice. "The Iran deal. I guess he thought it was okay. We were not really thinking the same," the president said.

But let's be honest. Really, it was the moron thing. That was the beginning of the end. If there is one thing our "very stable genius" of a commander in chief cannot stand, it's being insulted and undermined. There was simply no way Tillerson would last. In some ways, it's a wonder he lasted this long.

And so now America will have a new secretary of state, this one presumably more line-toeing and loyal.

What will Pompeo's State Department look like? When he faces the Senate Foreign Relations committee, he will surely be questioned by Democrats and Republicans alike about whether he will recapitalize the department, which has been vitiated under Tillerson. Whatever he says will not prove too much of an obstacle, however. The Senate will want Trump to have a full team in place before the start of serious negotiations with North Korea. They might also see Pompeo as someone who can gently nudge Trump from the ledge in terms of a draconian trade war.

Meanwhile, Haspel, a respected CIA insider, will face questions about her knowledge of the CIA's rendition, interrogation, and detention policies, and her willingness to speak truth to power, especially when it comes to Russia. She would oversee the country's covert response to Russian election meddling, after all, and her knowledge of the intelligence equities and sensitivities is probably deeper than Pompeo's. Trump is likely to be lauded by national security professionals for choosing her.

But moving forward, the lessons of Tillerson's rocky tenure should be obvious to all members of Trump's team: Don't cross the boss. He simply will not stand for it.