The flare-up between Ms. Pelosi and Ms. Ocasio-Cortez and her allies, Representatives Ilhan Omar of Minnesota, Rashida Tlaib of Michigan and Ayanna S. Pressley of Massachusetts, in some ways echoed those themes.

In an interview with the New York Times columnist Maureen Dowd, Ms. Pelosi complained that the upstarts did not understand how government works, dismissing their digital following as “their public whatever.” They in turn complained that Ms. Pelosi’s record of achievement was inadequate because she was too willing to compromise rather than confront Republicans on issues like the migrant crisis at the border.

There is, of course, no little irony that Ms. Pelosi and Mr. Ryan are now the beleaguered defenders of the old order, given that both of them were once seen as champions of the ideological extremes of their parties — she as a radical San Francisco leftist, he as a Medicare-destroying right winger.

But they both came up within the system that is now under pressure from impatient newcomers who see no virtue in spending years in the backbenches waiting for their turn when they can be empowered by Twitter to wield influence in ways that would have been unthinkable in the past.

“Because of social media and because people can be their own stars, they don’t need to work through leadership or through hierarchy,” said Representative Josh Gottheimer, Democrat of New Jersey and a leader of the Problem Solvers Caucus, a bipartisan group seeking to find consensus in a House where that is a dirty word. “They work outside in. That is a huge challenge because technology allows it.”

The outsiders are, in their own ways, tapping into the same disenchantment with the two-party system that Mr. Perot did. When he attracted 19 percent of the vote in 1992 against Mr. Clinton and President George Bush, it was the most any independent presidential candidate had generated since Theodore Roosevelt’s unsuccessful comeback bid in 1912 and the most any independent candidate who had not previously served as president had received since the advent of the two current parties just before the Civil War.