Washington (CNN) President Donald Trump is the latest Washington politician to learn a hard lesson: House Speaker Nancy Pelos i knows how to wield her power effectively.

The pitched battle between the two leaders over whether the President would deliver his State of the Union address in the House chamber next week, in the midst of the ongoing government shutdown, ended after Pelosi rescinded her invitation on Wednesday. Within minutes, Trump threatened to find an alternative location to deliver the speech -- only to back down hours later.

At her weekly press conference Thursday, Pelosi calmly called the dispute "so unimportant" for most Americans. But even this minor victory demonstrates the California Democrat is comfortable in her position to go toe-to-toe with a President who has confounded so many others who have found themselves at odds with him.

"She is ruthless and relentless in advancing toward her goals, whether political or policy," says Michael Steel, who worked as former House Speaker John Boehner's top spokesman. "She understands that power and the opportunity to get things done is a brief and transitive thing."

That helps make her the most formidable political opponent Trump has encountered in his short political career. Since declaring for president in 2015, Trump has essentially bested every foe he's faced. He dispatched the 16 Republicans in the 2016 primary, beat Hillary Clinton in the general election and then bent the party to his will after taking office. Since he became President, those who have opposed Trump have either lacked the power to do it effectively (Democrats), fallen in line (Marco Rubio, Ted Cruz) or have departed the political arena entirely (Jeff Flake, Bob Corker).

But while the Trump train careened generally unimpeded when Republicans were in charge, Pelosi is a real immovable object --knowledgeable in the institutions of Washington, empowered by a unified party behind her and intimidating to a President unaccustomed to dealing with a woman in power. She has the ability and incentive to stand firmly and confidently in opposition. And in the first test of this week, Trump blinked.

"She's been in the fight before," says Nadeam Elshami, Pelosi's former chief of staff. "She knows where the power lies."

Most importantly, she knows where her power lies, having spent four years as speaker working with a president in each party.

"She understands the tools of the speakership," said Patrick McHenry, the eight-term Republican from North Carolina who also served during Pelosi's first time with the gavel.

"She has an excellent understanding of power dynamics," says Steel.

A life in politics

Pelosi's tenure in Democratic leadership has been defined by a kind of old-school urban politics approach shaped by her upbringing in the midst of the Baltimore Democratic political machine. Her father, Thomas D'Alesandro, was a five-term congressman from Maryland and later Baltimore's mayor for 12 years, and her older brother also served as mayor. Pelosi moved to San Francisco and became a powerful figure in that city's own Democratic machine before her run for Congress in 1987.

This machine-politics pedigree manifests itself in her well-known ability to exert dominance on her caucus. Throughout the eight years Pelosi was minority leader during the Obama and Trump administrations, Democrats remained unified on every major vote. She maintained that unity through the first vote of the new Congress, her election as speaker , despite the serious threats to her leadership from critics within the caucus.

Just "Nancy"

Pelosi frequently exerts soft power. Rep. Ed Perlmutter, the Colorado Democrat who helped broker a deal between Pelosi and rebellious members who tried to block her rise to the speakership, told reporters in December that Pelosi maintains good relationships across the caucus. "She has a lot of skills and knowledge that most of the rest of us don't," Perlmutter said. "She is very good at what she does, and she's got a lot of relationships, and there's a lot of respect for her within our caucus."

But Pelosi is also unafraid to use retaliation as a tool. Most recently, Reps. Kathleen Rice and Anthony Brindisi, both House Democrats from New York who had been critical of Pelosi during the 2018 campaign and voted against her for speaker , were denied committee assignments they had lobbied for, moves seen as retribution by Pelosi.

That kind of perception has earned her respect (and perhaps a bit of fear) from Trump.

"I think the President has respect for allies or opponents who he sees as strong," said Marc Short, Trump's former legislative director in the White House and a CNN contributor. It's no accident that Trump, so deft at assigning humiliating nicknames to dismiss his foes, refers to Pelosi simply as "Nancy."



Hard won respect

That respect for the speaker is a change of pace for Trump, who publicly and privately has shown no such feelings toward Pelosi's GOP predecessor. In a scene from his forthcoming book Team of Vipers, former Trump aide Cliff Sims describes a phone conversation between Trump and Paul Ryan, who had just criticized the President's response to the deadly white supremacist rally in Charlottesville, Virginia.

"Paul, do you know why Democrats have been kicking your a-- for decades?" Sims recalls Trump saying. "Because they know a little word called 'loyalty.' Why do you think Nancy has held on this long?"

Short said Trump's grudging respect for Pelosi means there's more opportunity for the Democratic speaker and the Republican President to work together where they may have common ground on policy, particularly on infrastructure and some elements of health care. That, of course, could only happen if the two sides reach the so-far elusive agreement on the shutdown and border wall.

Sitting House Republicans, however, see a vulnerability behind Pelosi's holding the line during the shutdown. "Her projection of strength is a bit of an artifice," said McHenry, who adds the freshmen Democrats are a "raucous set" clamoring for confrontation, not negotiation, with Trump. "It limits her capacity to negotiate."

GOP leadership, meanwhile, is arguing that Pelosi's tough stance on postponing the State of the Union is unreasonable and self-destructive. "I think it's time for the Democratic Party to have an intervention with the speaker," Wyoming congresswoman Liz Cheney, the chairman of the House GOP conference, told reporters Thursday.

Not every Republican thinks Pelosi is a problem for Democrats. In fact, some admit that she just might be the perfect foil to Trump: a woman, well-versed in the art of political combat, and vested with the power of an office she knows how to wield.

"I think her entire life and background have prepared her to be an effective opponent for President Trump," Steel said.

After a long day of partisan battles on Capitol Hill, Pelosi took in a basketball game between the Washington Wizards and her visiting hometown team from the Bay Area -- the reigning NBA champions who last year declined the traditional visit to the White House in protest of Trump -- fittingly nicknamed the Warriors.