Race, in those contexts, no longer serves as a meaningful way to divide social space. The importance of race as a social category is (at least partially) replaced by the importance of the team.

In certain situations, a context that emphasizes division is permanent, making reconciliation virtually impossible. When the Boston Red Sox play the New York Yankees, for example, conflict between their fans is unavoidable; it’s built into the very structure of the game. This is also true of Republicans and Democrats in a presidential election. In the Middle East, conflict between Israelis and Palestinians is not a formal feature of the region, but because it has become so deeply embedded in the fabric of social, political and economic interactions between the two groups, it can feel insurmountable.

Luckily for the Democratic Party this year, the context of a primary season is much more transient. And the shift to the general election focuses attention on a different contrast: in this case, Mrs. Clinton versus Mr. Trump. Just as a common goal broke down the barriers between Eagles and Rattlers, the desire to avoid a Trump presidency should change the way Sanders supporters view themselves. The realignment will leave many supporters of the defeated primary candidate psychologically wanting to be won over by their party’s nominee.

In a 2009 study, one of us (Professor Rand) looked at the changing attitudes of Democrats in the 2008 primary fight between Mrs. Clinton and Barack Obama. In the waning days of that primary, participants in this study played the “dictator game” from behavioral economics, in which they were given the opportunity to divide a sum of money between themselves and another person. Clinton supporters shared substantially less with Obama supporters than with fellow Clinton supporters. This apparent hostility persisted throughout the summer, despite Mrs. Clinton’s having conceded the nomination to Mr. Obama in early June.

But the hostility disappeared immediately after the Democratic National Convention at the end of August, with study participants who were Clinton supporters now sharing equally with those who were Obama supporters. A common goal of defeating the Republican candidate, and a resurgent identity as Democrats, seemed to undo animosities even more quickly than they had arisen.

Of course, the Democratic primary this year revealed important policy differences between Mr. Sanders and Mrs. Clinton. And the Democratic National Committee email leak brought the primary-season divisions back to the fore. But while the political particularities of the present moment merit consideration, lurking beneath them is a human tendency to forge alliances as the context demands. And for Democrats, the context is now the threat of a President Trump.