Her comments clearly got under the president’s skin. Late Thursday afternoon, he revoked her military transport for a secret trip to Afghanistan — a visit to a war zone that Mr. Trump derided as a “public relations event.” He suggested Ms. Pelosi, second in line for the presidency, fly commercial. To Afghanistan.

Ms. Pelosi’s aides and supporters quickly pointed out that her plans included thanking the troops and meeting with the commanders of the war that Mr. Trump is trying to end. Mr. Trump, in fact, made his first visit to a warzone during this same shutdown.

Now, none of the fighting over flights gets the country any closer to ending a government shutdown that’s crippling the finances of 800,000 federal workers and starting to have economic impacts far bigger than even the White House anticipated.

But it is some awfully crafty politics by Ms. Pelosi.

A 78-year-old, wealthy San Francisco liberal, Ms. Pelosi is nobody’s idea of an everyman politician. Forget fast food — Ms. Pelosi eats dark chocolate ice cream for breakfast. Her campaign superpower involves twisting the arms of rich donors. She doesn’t really use Twitter, never mind Instagram.

And yet, right now, she might just be the most powerful politician in the country.

Dozens of Democrats spent months campaigning against supporting Ms. Pelosi as speaker. (Worth noting: G.O.P. attacks on her far outpaced mentions of any other congressional leader in campaign ads for the last three cycles.) In the end, after a weekslong campaign by Ms. Pelosi put down any hint of rebellion, only 15 members cast ballots against her.