But with the energy in today’s Democratic Party flowing from the left, Ms. Pelosi often finds herself herding her team back toward the center. Whatever her ideological sympathies, she does not intend to let woke progressives damage members from more competitive districts and imperil her majority. The bigger and more diverse the caucus, the harder she has to work to keep it in balance.

“Sometimes part of leadership is pushing against currents so that the caucus never tilts too far off — I wouldn’t say the center — but the mainstream,” Chicago’s departing mayor, Rahm Emanuel, who served in leadership with Ms. Pelosi during the George W. Bush years, told me.

Ms. Pelosi remains dismissive, in that grandmotherly way of hers, of some of the bolder ideas backed by caucus rabble-rousers. This month, she oversaw the passage of environmental legislation focused on keeping the United States in the Paris agreement on climate change — a far cry from what she dismissed as the “Green Dream or whatever” championed by the freshman phenom Alexandria Ocasio-Cortez of New York. And the speaker supports shoring up Obamacare rather than starting from scratch with a single-payer plan.