As the third decade of the 21st century opens, the United States finds itself in a paradoxical situation: The economy is booming, unemployment is historically low, the nation is not involved in any major wars, and the international situation is (for the moment) reasonably stable. Yet voters do not feel stable or happy: On the right, many believe that the country they knew is being taken away from them by immigrants and shadowy elites, while for the left, democracy itself is being challenged by a Republican Party that has turned into a cult of personality. In 2016, America elected a president whose personal characteristics — narcissism, ignorance and barely disguised racism — should have immediately disqualified him. Yet Donald Trump became president and remains an object of adulation for at least a third of the country.

Francis Fukuyama is Mosbacher director of the Center on Democracy, Development and the Rule of Law at Stanford and the author of “Identity: The Demand for Dignity and the Politics of Resentment.”

This polarization is perhaps the single greatest weakness of the American political system today, a weakness that authoritarian rivals like Vladimir Putin’s Russia have gleefully exploited. It is the subject of a superbly researched and written book by the journalist and commentator Ezra Klein, founder of Vox and host of a popular podcast. Klein argues that polarization exists for structural reasons having to do with the incentives created by U.S. institutions, and that our current predicament is not the result of individual leaders and the choices they make: It existed long before Trump took his famous ride down the escalator in Trump Tower and will unfortunately survive regardless of who is elected in November.

The bottom line of Klein’s argument is that polarization was driven fundamentally by race. The Republican Party has become the home of angry white voters anxious that the United States is turning into a “majority minority” society, as California already has, a reality epitomized by the election of Barack Obama.

There is no question that race played an important part in the 2016 election and that for many Trump voters, cultural identity was a more significant factor than economic self-interest. It is otherwise impossible to explain why so many working-class whites supported Republican efforts to repeal Obamacare, a policy that benefited them above all.

But cultural identity is fed by many factors besides race, and understanding this complexity is very important if the Democrats hope to win back the Oval Office and Congress. Failure to appreciate the legitimate grounds for resentment by populist voters is a general failure of liberals everywhere, from Turkey and Hungary to Britain and the United States, and one of the reasons they keep losing elections.

Klein has done his homework in reviewing the extensive academic literature on the subject and interviewing scores of actors immersed in practical politics. The fact of polarization is not in question and it stems from the momentous political realignment that took place after the 1960s. Klein cites a famous study by the American Political Science Association from the 1950s complaining that the Republican and Democratic parties were too similar and didn’t offer voters real ideological choices. In those days, the two parties were large coalitions of heterogeneous interest groups. The Democratic Party, in particular, brought together an odd alliance of Northern liberals, working-class trade unionists and Southern segregationists. This changed in the 1960s when the Democrats embraced the civil rights movement, which led to a multigenerational shift by the South toward the Republican Party. The two parties became much more ideological and homogeneous by the early 21st century, such that the most liberal Republican lay to the right of the most conservative Democrat.

This part of the story has been well understood for many years; what has puzzled observers is why polarization has more recently intensified into what political scientists label “affective polarization,” a highly emotional attachment to one’s side that defies considerations of rational self-interest. Here Klein, like many others, reaches into the realm of social psychology and notes a basic human propensity to form powerful group attachments: Being red or blue has come to constitute an identity rather than an ideology. He cites a large literature suggesting that human cognition does not begin with facts and work its way to interpretations; rather, humans start with preexisting identities and use their considerable cognitive skills to justify positions they somehow know in advance to be right. Under these conditions, having more facts and information does not necessarily lead to better decisions. Klein cites one rather depressing study in which better-informed partisans were more attached to their incorrect opinions than people who were more ignorant.

These two phenomena — the Southern realignment and the human propensity to bond with groups — bring us to Klein’s central conclusion about the centrality of race for Trump voters and Republicans who believe their white identity is under threat.

The remainder of “Why We’re Polarized” catalogues the many other institutional sources of the underlying divide. The media, and especially social media, thrives on virality; it no longer reports news but creates news based on what sells. Changes in our campaign finance laws have weakened the political parties; this plus the spread of popular primaries has opened both parties to more extreme positions, since activists on left and right are the ones who donate money and vote in primaries. The fact that the United States has a presidential system and winner-take-all elections raises the stakes in contests and promotes extremist behavior, like Republican Senate Majority Leader Mitch McConnell’s sidelining of Supreme Court nominee Merrick Garland during the final year of Obama’s presidency. Finally, local politics, which used to be resistant to larger national trends, have also become polarized because of outside money and national media.

“Why We’re Polarized” provides a highly useful guide to this most central of political puzzles, digesting mountains of social science research and presenting it in an engaging form. There are two areas of weakness, however, in an overall outstanding volume.

The first has to do with the central contention that our current polarization is fundamentally about race. Klein dismisses economic drivers of populism like globalization and the loss of working-class jobs, noting that if those were the fundamental issues, then left-wing populism rather than the nativist variety should have seen a big upsurge in support.

There is no question that race has resurfaced in an ugly manner in American politics, driven by an overtly racist president. But culture and identity are much broader than race. Gender is at least as important: Men have been losing status and economic power to women in workplaces and families steadily for the past generation. Many people in 2016 didn’t so much support Trump as vote against Hillary Clinton, who represented to them a certain kind of self-satisfied feminism and came into the election with very low trust and favorability ratings.

The urban-rural divide that Klein correctly notes as central to the red-blue division encompasses a host of cultural values beyond race, related to religion, patriotism, respect for traditional sources of authority and other lifestyle issues. Working-class whites in rural areas have undergone a social decline epitomized by the opioid crisis, which has led to a drop in male life expectancy in the United States. As Angus Deaton and Anne Case have argued, this is a result of despair engendered by job loss and social isolation.

Opposition to our current immigration system does not necessarily have to stem from xenophobia and racism: Polls from Gallup and Pew show that more than 60 percent of Americans have positive views of immigration but more than 50 percent worry that so much of it is illegal. High culture today is produced in liberal agglomerations like New York, Los Angeles and London, and it has created a kind of intellectual snobbery that is bitterly resented by people who don’t like being dismissed as ignorant racists.

The book’s second weakness lies in suggested solutions, which Klein admits are not his strong point. Normatively and as a matter of practical politics, no reform is conceivable that disproportionately benefits one party over the other: His suggestions of congressional representation for Puerto Rico and the District of Columbia, or abolition of the electoral college, may be desirable in themselves but will never pass until the Democrats take over all three branches of government (in which case our polarization problem will have been largely solved). There are other reforms, however, like ranked-choice voting, term limits for Supreme Court justices or the elimination of the filibuster, that do not have clear implications for long-term electoral outcomes. Ranked-choice voting, in particular, may attract Republican support and is my leading candidate for reform.

Klein opens his book by dismissing individuals and leadership as explanations for polarization, in favor of structural or institutional factors. That may be a proper analytical stance, but often structural change can come about only as a result of external crises combined with the proper visionary leadership. Democrats will not win back swing voters by writing off their opponents as simple racists and xenophobes; they need to show empathy for the legitimate concerns of a working class that is in serious trouble. Identity is an inherently flexible concept that can be deliberately shaped in broader or narrower ways. Liberals around the world have lost ground to populists by ignoring the broad moral appeal of national identity, which in a diverse contemporary society needs to be built around liberal and democratic values. Klein dismisses complaints about political correctness and identity politics on the left, but a politics built on the grievances of ever narrower identity groups breeds similar thinking on the right, and it cannot be the basis for a broader democratic, civic identity that is the ultimate answer to polarization.

“Why We’re Polarized,” By Ezra Klein. Avid Reader/Simon & Schuster. 312 pp. $28