WASHINGTON — The John Boehner/Nancy Pelosi agreement on Medicare doctors’ payments — permanently easing up on scheduled cuts, funded (partially) by means testing — has been praised as an incremental gain and criticized as a small backward step. In either case, it is a rare bird: the result of a March 4 meeting between leaders in a metaphorical smoke-filled room (and, given Boehner’s smoking habit, perhaps an actual one).

The broad acceptance of the compromise by House Republicans and Democrats is rooted in a shared interest. Both sides hate being nagged by doctors. This is not a motivation easily transferable to other issues. But the Medicare deal is a reminder of the way strong party leaders once regularly made law.

The model is now rare. It is also viewed by some partisans as a vice. Leaders who make deals are regarded (particularly on the right) as politically and even morally compromised.

This suspicion about compromise should be surprising in a nation that resulted from the Great Compromise. But it reflects a broader trend that has reshaped the attitudes of both parties: polarization.

Political scientists disagree over the question of whether the ideological views of Americans have become more extreme over time. But they generally agree that America’s two main political parties have become more sorted, both ideologically and geographically. And they tend to agree that the views of party adherents across a range of issues have become more ideologically predictable.

Ideological sorting has been growing since the 1970s, and involves the collapse both of southern Democratic conservatism and of northeastern Republican liberalism. For the first time (at least in the modern political constellation) America has a liberal party and a conservative party. (The Democratic coalition remains more ideologically diverse, but it has recently been sorting at a faster rate.)

This large historical shift does not lend itself to a single structural explanation such as gerrymandering (since the phenomenon can also be seen in Senate and county elections, not just House races). Liberals tend to argue that the trend is an outworking of Civil Rights-era racial politics or of growing economic inequality. Conservatives contend there has been a long-term backlash against the policy failures of modern liberalism, resulting in the emergence of such figures as Ronald Reagan and Newt Gingrich.

Whatever the cause, ideological sorting has naturally encouraged division. Conservatives and liberals no longer see people who think the way they do in the other political party. And the disagreements are exaggerated by geographic clustering. There is evidence that some Americans are choosing where they live to maximize their ideological comfort — which increases their sense of belonging, as well as their partisan contempt.

Congress both reflects and encourages these divisions. Voting patterns have become polarized over time. More issues (from abortion to climate disruption) have become high-stakes, zero-sum ideological battles. The normal processes of budgeting and handling appointments have been disrupted. A long period of relative political parity between the parties has encouraged the belief that the next election might bring a victory so complete that compromise will no longer be necessary.

But this is only part of the story. At the same time we have experienced ideological sorting, we have also seen a technological and communications revolution that has encouraged political fragmentation. Backbenchers such as Sen. Ted Cruz (or, potentially, Sen. Elizabeth Warren) have avenues of influence and fundraising entirely outside the parties — and ideological PACs, talk radio hosts and bloggers have agendas very different from party leaders. This is part of a larger, accelerating social trend in which big, consolidated institutions — big business, big labor, big media — are giving way to smaller, decentralized networks. In politics, this decentralization has debilitated the legislative branch, which works through consensus. (The executive branch, being more unitary, has been relatively strengthened.)

We are left with highly ideological parties, headed by weakened legislative leaders — a recipe for bitterness and gridlock. And so the solution to the deep division between parties must (in a seeming paradox) involve stronger parties. It is parties that eventually have an interest in creating a broadly accepted public image (in the current Republican case, of reform conservatism) particularly after they lose the presidency a few times.

Want to fight gridlock? Make it easier to donate large sums to parties — instead of having a campaign finance system that grants inordinate power to ideological PACs funded by eccentric billionaires. And appreciate the forgotten virtues of the smoke-filled room.