House Minority Leader Nancy Pelosi, D-California, speaks Wednesday during a news conference on Capitol Hill in Washington. Pelosi says she's confident she will win enough support to be elected speaker of the House next year and that she is the best person for the job. Credit: J. Scott Applewhite | AP

President Donald Trump is absolutely right: Nancy Pelosi should be the next speaker of the House.

But not for the reasons the president gave when he sent out this tweet, a surprising one given how he and his party have demonized Pelosi throughout the 2018 campaign:

Being speaker is not a “great honor.” It is a job. Pelosi should get it — at least for the next two years — because she is good at it. In the four years she held the gavel, many scholars of Congress say, she consolidated and wielded the power of that office more effectively than anyone in modern history.

At her news conference Wednesday, Pelosi bristled at Trump’s statement that she “deserves” the speakership. “It’s not about what you have done,” she said. “It’s what you can do.”

None of this is to argue that the House Democrats do not need fresher, younger leadership. Pelosi is 78, and her top lieutenants, Minority Leader Steny Hoyer of Maryland and Assistant Minority Leader James Clyburn of South Carolina are 79 and 78, respectively. Pelosi surely understands that she needs to look for new talent as she fills out her ranks.

No doubt the caucus will also demand it, even if no serious challenger emerges to take her on in a leadership fight. During the campaign, dozens of Democratic candidates distanced themselves from her, some echoing the call of Rep. Seth Moulton of Massachusetts for “a new generation of leadership” in Washington.

But her experience is especially important now because there is so little in the army she would be leading. Only three of the incoming Democratic committee chairmen have ever held that position before. More than half of the incoming Democratic caucus has never been in the majority.

Pelosi’s legislative skill was on display most vividly in the first year of the Obama presidency, when she and her 81-vote majority passed every item on his agenda — most breathtakingly, during the high-wire act that produced the Affordable Care Act.

She can count votes, and she can turn them. Her longtime adviser, former representative George Miller, D-California, once told me that when he watched Pelosi work the House floor for votes, he could hear the theme music from “Jaws” playing in his head.

No less an adversary than former speaker Newt Gingrich, a Republican, said of her at a recent Washington Post Live event: “Nancy Pelosi is a very smart, very tough person who has earned her position by just brute hard work, by applying her intelligence and by building a network that has sustained her for a long time.”

What may serve her best now is the seasoning she got in two years as speaker under a Republican president, George W. Bush.

Though Republicans love to caricature Pelosi as a dippy liberal, she proved that she is, at her core, a political pragmatist. One of her first acts was to disappoint the fervent Democratic base with an announcement in 2006 that Democrats would “absolutely not” cut off funding for the Iraq War: “As long as our troops are in harm’s way, Democrats will be there to support them.”

Her street-wise political instincts, honed from her childhood as the daughter of a Baltimore mayor, helped lay the groundwork for the party’s spectacularly successful performance two years later.

As she heads into 2020 with a small and fragile majority, Pelosi understands, and is equipped to deal with, tensions within her party. She can balance the passions of the hard left, and with the caution needed to protect more moderate members whose election in swing districts put the party back in power.

Count on Pelosi to put the brakes on premature calls for Trump’s impeachment, and to press the mute button on more radical proposals such as abolishing Immigration and Customs Enforcement. At the same time, she can muster the votes to bring the Republicans’ legislative agenda to a halt.

Pelosi’s biggest liabilities — her negative poll numbers, the clumsy comments she is prone to making — will become less of a factor. The front-facing image of the Democratic Party will be its large crop of presidential contenders. Pelosi can focus on the inside game, at which she excels.

The speaker-in-waiting has indicated she is not in this for the long haul. She has recently begun describing herself as a “transitional figure,” and spoken longingly of writing books and spending more time with her grandchildren.

But right now, her party needs Pelosi. The question is whether Democrats are smart enough to recognize that.

Karen Tumulty is a Washington Post columnist covering national politics.