When Trump began putting together his cabinet, liberals and some in the media expressed concern over the number of retired generals he was appointing to top positions.

“Trump hires third general, raising concerns about heavy military influence,” blared a headline in the Washington Post during the presidential transition.

“I am concerned that so many of the president-elect’s nominees thus far come from the ranks of recently retired military officers,” the Democratic representative Steny Hoyer told the Washington Examiner in December.

The fretting over Trump’s generals was always misplaced, not least because the number of retired generals Trump has appointed to top positions in his administration is hardly unprecedented. Trump nominated the retired Marine generals James Mattis and John Kelly to lead the Department of Defense and Homeland Security, respectively, and tapped the retired army general Mike Flynn to be his national security adviser. When entering office after winning the 2008 presidential election, Barack Obama also appointed three retired generals to top positions and few batted an eyelid.

But those concerned about Trump’s presidency should be thankful that the generals are there, particularly Mattis and Kelly. By all accounts, they are men of great honor and courage with strong backbones. Kelly led men into battle and lost a son fighting in Afghanistan. Mattis may be the most distinguished and respected Marine officer of his generation, revered for his dedication to his troops and his intellect. I had the honor of spending an hour with him one-on-one last May when he was a fellow at the Hoover Institution. Our conversation was off the record, but make no mistake, this is not a man to be trifled with.

Not too many in Congress have great loyalty to Trump. More than anything, they fear his core supporters

Trump may have actually boxed himself in by picking highly respected generals such as Kelly and Mattis to helm top posts in his administration. Even conservatives who publicly stand by the president latch on to the appointments of Mattis and Kelly as their best evidence that Trump’s presidency will not be as problematic as his temperament and actions sometimes suggest, or some of his more troubling White House advisers portend.

But if Mattis or Kelly were to resign in protest, that might change everything.

There have already been reports that Mattis and Kelly are less than happy with some of what has gone on in the White House. During the transition, Mattis reportedly clashed with the Trump transition team over key appointments to the defense department. Tensions boiled over when Mattis and Kelly weren’t given sufficient consultation over the recent immigration executive order.

The Democratic representative Seth Moulton, a retired Marine who served under Mattis during the Iraq war, says insiders have informed him that after the executive order fiasco, some top appointments like Mattis began thinking about what would make them leave the administration.

“What I’ve heard from behind the scenes,’’ Moulton told the Boston Globe: “What will make you resign? What’s your red line?”

In the aftermath of the immigration order, the Morning Joe host Joe Scarborough reported that Trump was destined for problems if he allowed ideological White House aides Stephen Miller and Steve Bannon to run amok like they reportedly did with the immigration executive order.

“If this did happen again, the president would have serious problems with his foreign policy team as well as the entire government,” Scarborough said.

Now Mattis and Kelly are patriots of the highest order and they would not likely resign from their posts for frivolous reasons. There is every reason to believe they genuinely want to help Trump succeed and they serve at the pleasure of the president, not the other way around. But it is not impossible to imagine a scenario where they are pushed too far. If, say, Trump tells Kelly to ignore a court order or demands Mattis pursue a policy that is illegal or he thinks would do catastrophic damage to the country, these are exactly the type of people who would tell the president, “I can’t do that, sir.” What Trump decided to do in such such a moment would likely determine his administration’s fate: back down or press forward and end his presidency.

You can take that statement seriously but not literally if you want, but there is good reason to take it literally too. If Mattis or Kelly were to resign in protest, it’s not impossible to imagine Republicans in Congress who have tepidly backed Trump up until this point revolting. Not too many in Congress have great loyalty to him. More than anything, they fear his core supporters. But the resignation of Mattis or Kelly could very well be the last straw.

As the conservative radio talk show host Hugh Hewitt noted in his recent book The Fourth Way, Trump shouldn’t discount the possibility of impeachment. There are a number of issues Democrats in Congress could seize upon to pursue removing the president if they had Republican allies willing to go along with them. Many Republicans in Congress would prefer a President Mike Pence to a President Trump anyway.

Or Republicans could question Trump’s sanity and use article four of the 25th amendment to try to oust him. The Republican representative Jason Chaffetz is reportedly already considering pursuing legislation that would require presidents to undergo independent medical examinations that would include a mental evaluation. I’m sure it’s just a coincidence he is pursuing such legislation now that Trump is president.

So forget all the handwringing about the generals in Trump’s cabinet. We should be thankful that they’re there. They are the canaries in the executive branch coalmine. Trump should understand that if presidency is to have any chance of success, he needs to work with his retired generals, not alienate them.