As pundits grappled with the realization that Donald Trump would be the next president in the days and weeks following election night, a common-sense narrative took hold. This election was about “the revenge of working-class whites,” the blue-collar, non-college-educated men across the key Rust Belt states of Michigan, Ohio, Pennsylvania, and Wisconsin whose lives had been devastated by globalized trade and deindustrialization — and who abandoned the Democrats to vote for Trump in droves.

According to this narrative, these voters’ frustration with the economic and social destruction they had experienced for decades exploded in a rage against “the establishment,” and found an unlikely tribune in Trump, who struck a nerve with his anti-trade, anti-immigration message.

Against this conventional wisdom, some countered that race and gender, not class, proved decisive. Pointing out that voters with annual household incomes under $50,000 voted for Clinton, they argued that Trump’s support was based in a layer of older white men who have seen their power and dominance threatened in an increasingly diverse United States.

For these analysts, the election was the revenge of the racist white patriarchy, those left behind by the shifting tide of history who couldn’t stomach the idea of a strong, successful woman as president. According to this narrative, Trump’s success lies in his willingness to appeal openly to the racism and misogyny of this key demographic.

While both narratives get important things right about why Trump won, they also leave troubling questions unanswered. How could the election be about class if the poorest voters still voted for Clinton? How could deep-seated racism explain Trump support when many of his voters supported Obama in 2008 and 2012? If misogyny was key to voters’ motivations, how did Trump turn out so many white women?

Each of these questions highlights a fundamental problem not only with the competing narratives about Trump’s victory, but with a core tenet of much conventional political analysis: the assumption that demographics are destiny.

The Clinton campaign relied heavily on this assumption during the campaign, slicing and dicing the electorate into ever-more-precise demographic categories, which they could then micro-target with ever-more-tailored political messages. It also figured prominently in post-election analysis, particularly in efforts to understand the seemingly decisive “white working class” demographic.

The core idea underlying the “demographics is destiny” assumption is that there is a clear and natural link between demographic traits, political issues, and policy proposals. We can see this, for example, in the contention that Trump’s proposals to “build a wall” and restrict immigration resonated with white men with nativist tendencies who felt threatened by foreigners and people of color.

This argument isn’t wrong. There likely were many white male voters who responded to Trump’s proposals in this way. The problem is that it assumes what needs to be explained: why did nativist xenophobia resonate as the solution to white working-class economic grievances?

At first glance, the answer might seem obvious. Racism and white supremacy run deep in the United States, and white workers have often responded to economic threats by lashing out at immigrants and people of color. We could easily see white working-class support for Trump as yet another chapter in this troubling history.

But simply chalking up support for nativist policies to deep-seated racism ignores the many instances where white workers have responded to economic threats by uniting with immigrants and workers of color around a message of class solidarity.

Most recently we have seen this approach both in the Bernie Sanders campaign and the Fight for $15 movement. But it has a lineage going back to the Congress of Industrial Organizations (CIO), the early Communist Party, the Southern Populists, and the Knights of Labor, among others. While each of these examples has its shortcomings, taken together they show that racism is not the inevitable response to economic threats.

What then determines whether workers respond to economic grievances with nativism or solidarity? In a word, organization.

Recent sociological research has refocused attention on the role that organizations like parties and unions play in actively shaping political identities and divisions, not simply reflecting them. Viewed through this lens, what becomes immediately apparent is the central role of two sets of organizations in explaining Trump’s victory: labor unions and the Democratic Party.

While unions have a checkered history when it comes to race, they are traditionally one of the few organizations that unite workers of many races, religions, and political beliefs around programs of economic justice. At their best, they have served as bulwarks against racism and xenophobia.

But with unionization rates currently barely over 10 percent overall, unions simply don’t have the reach they once did. Union decline has left the field open to other players to shape the political narrative that workers use to make sense of their economic grievances.

But beyond their numerical decline, unions have lost their ability to shape the political actions of the members they still have. We saw this in the exit polls, which showed that only 51 percent of union households voted for Clinton, even less in the Rust Belt states. This was the lowest percentage since the 1984 Reagan landslide.

To understand this, we must address the relation between unions and another organization — the Democratic Party.

While the relation has been thorny since it was forged in the 1930s, in recent decades the Democrats have increasingly taken workers’ votes for granted. They have relied on unions to deliver funds during campaign season and votes on election day, while offering little in return. Much needed labor law reforms have taken a back seat, while signature Democratic Party achievements like NAFTA, welfare reform, and immigration crackdowns have hurt workers and their unions.

So dismissive have the Democrats become of their labor base that when Clinton was asked during the presidential campaign to take a stand against so-called “right-to-work” laws, an existential threat to labor, one of her top advisers demurred, saying “I like staying more at platitudes about what unions have done for workers.”

Comparing Clinton’s union platitudes with her concrete support for pro-business free-trade policies and coziness with financial elites helps to explain the Clinton “enthusiasm gap” among union voters, particularly in the critical Rust Belt counties that cost her the Electoral College. Many workers of color stayed home rather than fulfill their demographic destiny as taken-for-granted members of Clinton’s base, while many white workers took a chance on Trump’s faux populism.

In the aftermath of the election, many within the Democratic Party seem to be clinging to the “demographics as destiny” idea. They await the emergence of a “new Democratic majority” as more liberal millennials and people of color become a larger share of the electorate, and the “basket of deplorables” that makes up their vision of the white working class dies off. But this election shows the bankruptcy of such a strategy.

There is a limit to which workers and the rest of the Democratic Party’s base can be browbeaten into settling for the “lesser evil.” Absent a positive vision of cross-racial economic justice, progressives will continue to lose ground to Trump’s nativist appeals.

Understanding Trump’s election starts with rejecting the idea that demographics are destiny. Instead, analysts need to focus on the role of political organizations in connecting identities to issues and forging political coalitions. That’s how Trump was able to win, but it’s also the key to making him lose.