WASHINGTON — President Trump has always taken a contrarian’s view of American military power: He wants to command the biggest, toughest forces on earth, and he wants to keep them at home.

The lessons that many in the Pentagon and the intelligence agencies learned in the post-9/11 era — that deployed forces are key to stopping terrorists before they reach American shores and vital to maintaining the alliances that keep the world safe — never resonated with Mr. Trump. He is far more engaged with the idea of using the military to secure the Mexican border than to counter Russia, Iran, North Korea and China.

And now, by ordering the small American force of 2,000 troops to leave Syria, Mr. Trump is about to turn his theory into practice. He is doing so to the quiet horror of many of his senior aides, who have long argued that to pull out of Syria (or Afghanistan, another conflict in which Mr. Trump has said America has no legitimate long-term role) is to ignore the lessons of the past two decades.

But even Mr. Trump’s biggest critics, the Democrats, will have a hard time going after him on this decision.