In an extraordinary White House meeting, Nancy Pelosi showed Tuesday why fellow Democrats need her as the next speaker of the House, going head to head with President Donald Trump over his insistence that border security requires Congress to fund his anti-immigration wall.

"The fact is you do not have the votes in the House," the veteran Democratic leader bluntly told Trump, disputing his contention he could get the House to pass his $5 billion request for the wall "in two seconds" if he wanted.

In that moment, Pelosi displayed the toughness and political savvy that has enabled her to survive for 16 years as Democratic leader, including four years as speaker from 2007 to 2011. Her leadership skills in maintaining party unity in a broadly disparate caucus rival those of the two greatest 20th century Democratic speakers, Reps. Sam Rayburn of Texas and Thomas P. (Tip) O'Neill Jr. of Massachusetts.

As the Democrats prepare to assume the House control they ceded eight years ago, with a massive freshman class and an uncertain political outlook, the last thing they need is an inexperienced leadership to deal with a Republican Senate, the vagaries of Trump's presidency and the looming threat from Robert Mueller's investigation.

In an age when congressional party leaders operate more by persuasion and consensus than the top-down style of the Rayburn era, the highest ranking woman in American political history has outlasted and out-performed three Republican speakers, Dennis Hastert, John Boehner and Paul Ryan.

Along with President Barack Obama, Pelosi was the person most responsible for satisfying the various Democratic interests to ensure the enactment of the 2010 Affordable Care Act, a landmark legislative achievement that appears to be surviving the best efforts by Trump and the outgoing Republican Congress to kill it.

In the past month, Pelosi, 78, has had to employ some of those very skills to tame a rebellion among three dozen Democrats who feel the party needs fresher, younger leadership than Pelosi and Reps. Steny Hoyer and James Clyburn, all of whom will reach their 80th birthdays in the next two years.

They include a number of freshmen who, seeking to counter GOP ads linking them to Pelosi, pledged during their campaigns they would not vote for her as speaker.

Judging from the recent Democratic Caucus and the refusal of any foes to directly take her on, she has made considerable progress. Two years ago, she had an open challenger, Rep. Tim Ryan of Ohio, who attracted 63 votes; this year, no one directly challenged her, and the number of votes withheld from her on the secret ballot dropped to 32.

Since then, Pelosi has been negotiating an agreement with her opponents, promising to limit her future terms as speaker so that, when the full House votes Jan. 3, she loses no more than 17 of the 235 Democrats and gets the necessary 218-vote majority.

What's interesting is that Pelosi, like Senate Majority Leader Mitch McConnell, has survived in a media age as very much of an "inside" congressional player, rather than a more public leader. Knowing her limitations, she tends to avoid public venues such as the Sunday talk shows, while succeeding through a combination of political instincts, substantive smarts and the fundraising skills she honed as the California party chair before her election to Congress in 1987.

She has also survived the best efforts by Republican strategists to demonize her as some left-wing San Franciscan, a political tactic that may have worked in past campaigns but was unsuccessful this year. Her national political standing remains negative, but no more so than Ryan's or McConnell's.

In a sense, political foes have always miscast her as a California liberal. Though she rose to political power in her adopted home, San Francisco, Pelosi is much more of a political pragmatist. She learned her politics in her native Baltimore where her father, Thomas D'Alesandro Jr., and her brother, Thomas D'Alesandro III, were both mayor. She and Hoyer, her longtime rival, were interns for the same Maryland Democratic senator, the late Daniel Brewster.

In the recent caucus elections, while re-electing Pelosi, Hoyer and Clyburn, Democrats laid the basis for the next generation to take over. They picked Reps. Ben Ray Lujan of New Mexico, 46, as assistant Democratic leader; Hakeem Jeffries or New York, 48, the caucus chair; and Cheri Bustos of Illinois, 57, chair of the Democratic Congressional Campaign Committee.

One of those three, probably Jeffries, may ultimately succeed Pelosi, but the caucus vote signaled it's not time yet for that inevitable transition.

Ironically, if Hillary Clinton had been elected president in 2016, Pelosi might well have retired, making way for younger Democratic leadership with the assurance another woman would take her place in the highest councils of government.

But two years later, circumstances have changed, making her return to the speakership an essential step for Democrats and the country when the 116th Congress convenes.

Carl P. Leubsdorf is the former Washington bureau chief of The Dallas Morning News and a frequent contributor. Email: carl.p.leubsdorf@gmail.com

What's your view?

Got an opinion about this issue? Send a letter to the editor, and you just might get published.