Will House Democrats depose Rep. Nancy Pelosi (D-Calif.) as their leader after the midterm elections? Scores of Democratic House candidates have been reluctant to back her. Some Democratic incumbents such as Rep. Seth Moulton of Massachusetts have called for new leadership. And Republicans are running negative campaign ads that tie Democratic candidates to Pelosi.

These are significant signs that Pelosi’s hold on power is not absolute. Nonetheless, she still has some big advantages as the incumbent leader, making it far from clear that Democrats will replace her with someone else.

This is what it would take to depose Pelosi

After the fall elections, the two congressional parties gather separately to select their respective nominees for House speaker, typically by secret ballot. The candidates who win a majority in each party caucus then advance to a public House floor vote when the new Congress convenes in January. Although members can vote for outside candidates — including people not in Congress — most vote for their party’s nominee. The candidate receiving the majority of the votes cast (excluding anyone voting “present”) becomes speaker, while the minority party’s candidate becomes minority leader. If no candidate receives a majority of the vote, additional rounds of voting are conducted until someone is elected.

Here’s what that means. If Democrats win control of the chamber in November, Pelosi’s opponents will have two opportunities to replace her. First, they could persuade a majority of House Democrats to vote against her in the first, party-only vote, which will be held in early December.

Second, a smaller number of Pelosi’s Democratic opponents could vote for another candidate on the House floor, blocking her from securing a majority. Those dissidents could vote for the Republican nominee (not likely); a compromise candidate that Republicans supported (only slightly more likely); or a third “spoiler” candidate who would force the chamber into several rounds of balloting. In the last scenario, Pelosi might eventually still be elected speaker, but only after negotiations between her supporters and opponents — which happened in 1923, the last time there were several rounds of balloting for speaker.

This is why Pelosi’s grip on power is at risk

Among Democratic members of Congress, several different camps oppose Pelosi, who has been the party’s leader since 2003. Younger, ambitious members are frustrated that they can’t move up the leadership ladder. Others, tired of being in the minority since 2011, believe changing leaders would help the party win this November, and hope Pelosi will take herself out of the running before then. Members of the Congressional Black Caucus (CBC) are also eager for more influence. One CBC member, Assistant Democratic Leader James E. Clyburn (S.C.), has even offered to run for speaker if Pelosi cannot garner enough votes.

Another sign that many of Pelosi’s colleagues are eager for new leadership is that her last election for leader, in November 2016, was closer than one would expect. Although she won in the caucus by a sizable margin, about a third of Democrats voted for her opponent, Rep. Tim Ryan (Ohio). That was the largest percentage of Democrats to vote against Pelosi in any of her contested leadership races since her first in 2001.

In fact, Pelosi herself has taken actions that acknowledge a considerable undercurrent of opposition to her leadership within the Democratic caucus. She bowed to pressure by delaying the leadership elections for one month, for instance, and recently said she was building a “bridge” to new leadership in the party.

Finally, there is opposition among a strikingly high number of first-time Democratic candidates, particularly those running in Republican and swing districts, who fear that moderate and conservative voters perceive Pelosi as too liberal. If enough of them are elected, they could join with disgruntled incumbents as a substantial anti-Pelosi bloc.

Don’t count her out just yet

Pelosi, nonetheless, has many advantages over any potential challenger. Removing an incumbent leader in the House isn’t easy: Roughly three-quarters of the 23 challenges to incumbent House party leaders since 1960 have failed.

Why do challenges so often fall flat? For one thing, party leaders, and Pelosi in particular, can secure support from fellow lawmakers by contributing funds to their reelection campaigns. In our forthcoming book, we show that campaign contributions from leadership candidates are positively associated with lawmakers’ votes for those candidates. Pelosi’s fundraising prowess is legendary: She has raised enormous sums for Democratic candidates this election cycle, which helps her against potential opponents.

What’s more, congressional candidates’ criticisms of Pelosi will not necessarily translate into a vote against her. Politicians are cautious about opposing incumbents in leadership races, in part because the punishment for backing the loser can be so strong. That means it’s important to parse their comments carefully. Many have advocated for new leadership, for instance, but fewer have said explicitly that they will vote against Pelosi. Pelosi herself has taken their opposition in stride, telling them to “do whatever you have to do, just win.”

The process for ousting an incumbent leader poses its own challenges. The caucus-only vote requires many Democrats to vote against Pelosi (probably more than 100, depending on the size of the party). If Democrats take the House, fewer dissidents would be required to back someone else on the floor vote for speaker. But because that vote is public, they risk retribution from Pelosi if their rebellion fails — just as Republican rebels were punished for opposing Rep. John A. Boehner (R-Ohio) when he ran for speaker.

Above all, no one has yet definitely declared as a candidate against Pelosi. Some House Democrats may want new leadership, but as the old saying goes, you can’t beat somebody with nobody.

To be sure, any number of developments could make Pelosi more vulnerable. Democrats could post a worse-than-expected electoral showing, an event that is often associated with leadership revolts. A strong opponent could emerge after the elections, as happened when Rep. Gerald R. Ford (R-Mich.) successfully challenged Republican leader Charles A. Halleck (Ind.) in December 1964. But until then, it’s better not to underestimate the staying power of the incumbent leader.

Matthew Green is a professor of politics at Catholic University.

Douglas Harris is a professor of political science at Loyola University Maryland.

Together they are the authors of the forthcoming book Choosing the Leader: Leadership Elections in the U.S. House of Representatives (Yale University Press, 2019).