Chris Hayes’s book Twilight of the Elites came out to respectful reviews and respectable sales in 2012, yet the book’s real moment is right now. Better than any other book, it explains why Donald Trump appeals to many voters, and why the political establishment has such a hard time understanding his success.

In the book, Hayes, the host of an MSNBC show and an editor at large for the Nation, argues that many middle-class people on both the left and right have come to believe that the system is unfair. Elites – including politicians, business figures, and prominent journalists — work to protect the privileges they and their kids enjoy. The gap between the mythology of America —that people can rise to the top through hard work and talent — and the reality of an unequal country is generating a political crisis, in which people lose their trust in institutions and become radicalized. (Full disclosure: Hayes is a friend, and I read and commented on an early version of the book.)

The crucial insight in Twilight of the Elites is that economic inequality is not just a statistical relationship, in which some people earn more and others earn less. It is also an engine that transforms institutions — the rules, regulations, and practices that every country needs. Elites — the people at the top — have financial, political and social resources. They are able to use these resources to reshape institutions to protect themselves and their children. In contrast, many middle-class people increasingly think that America’s institutions are a rigged game where the powerful and connected have a dealer’s edge.

Hayes talks about class, but in the ways that the German sociologist Max Weber and his student Robert Michels do, rather than Karl Marx. Class and social status are entangled, so that people think about the world not only in terms of what they have but in terms of their relative status with respect to others.

Hayes spends a lot of time talking about how inequality is like a mathematical fractal — it keeps reproducing the same patterns the further you get in. People who are in the top 1 percent view themselves as middle class because they compare themselves to the 0.1 percent, and the 0.1 percent are insecure vis-à-vis the top 0.01 percent.

Meritocracy is how elites justify their existence

The Twilight of the Elites argues that the mythology of meritocracy holds all of this together. In a meritocratic system, people who have greater merit rise to the top. The idea of meritocracy tells elites that they deserve their superior position because they work harder and have greater natural ability than ordinary people. Meritocracy has opened up elite institutions like Harvard and Princeton, which used to discriminate systematically against Jews and African Americans and not admit women. Now they are nominally open to everyone.

The problem is that openness in theory does not translate into openness in practice. Hunter College High School, in New York, which Hayes attended, admits kids on the basis of a ferociously competitive entrance exam. Nonetheless, over time this system has grown to favor some kids over others. If your parents are well off, they can pay for you to spend weekends with specialized tutors prepping for the test. If they are not, you have to take your chances. The consequence is a sharp drop over time in the number of Latino and African-American children attending Hunter. Meritocracy is blind to the fact that some people face structural disadvantages and others do not.

Hayes acknowledges that meritocracy has advantages over the system of special privilege for white Protestants that it replaced. However, he says that it is unsustainable in the long run. Riffing on Michels’s "iron law of oligarchy," which holds that all democratic institutions will end up being run by an internal elite, Hayes proposes what he calls the iron law of meritocracy. He argues that the equality of opportunity that meritocracy promises will inevitably be overwhelmed by inequality of outcome. The people who do well from meritocracy will invest the proceeds from their success in working the system to make sure that they and their kids have the resources they need to continue to do well.

In the US today, the wheels of meritocracy are falling off

As America becomes more unequal, it’s ever harder to claim that it is a meritocratic country. It still looks like one to the people at the top, who continue to prosper. However, their view of the world is increasingly at odds with the view of people below, who like the idea of equal opportunity but don’t believe it is working.

The people at the top and the middle class are increasingly distant from each other. Elites don’t understand the challenges and frustrations of middle-class people. (As Hayes puts it, "Power narrows the vision of the powerful.")

But many middle-class people don’t believe elites when they say that the system is working well. They see institutions that are failing and corrupt. They interpret the government’s response to the economic crisis as evidence that well-connected people will get bailed out while other people are screwed over. They do not trust the traditional press anymore, and are able to find alternative sources of information that may often be wrong but at least reflect their understanding that there is something basically wrong with American politics.

While poorer people have always been at a disadvantage in the American system, middle-class people have historically had more faith in it, yet they are increasingly finding their expectations frustrated.

Trump’s anti-establishment campaign speaks to the frustrated and stalled

Hayes’s book suggests there are a lot of people who think that the system is broken, and that they can be politically mobilized. Donald Trump’s appeal is based on the claim that he is an anti-system politician. Unlike other politicians, he is prepared to tell it like it is, and to stick it to elites. Unsurprisingly, many elites, including elites within the Republican Party, are aghast. Senior Republicans are quietly rooting for Trump to lose. Core members of the intellectual wing of the party have publicly expressed their shock and abhorrence.

But does this actually explain support for Donald Trump? After all, it’s hardly rare for politicians to claim that they are running against Washington. There is some reason to believe that it does have explanatory power.

Hayes argues that the angriest voters are not going to be the people at the bottom, but the people in the middle, who used to expect that they and their kids could do well through enterprise and don’t believe that anymore. Experts have disagreed over whether Trump supporters are richer or poorer than the average. Yet emerging evidence is beginning to portray a more nuanced portrait of Trump's supporters than those earlier takes.

Jonathan Rothwell, a senior economist at Gallup, has used survey data on nearly 113,000 Americans to ask what really drives Trump support. He finds that support for the mogul turned politician is concentrated in the middle-income categories; in contrast, those who are relatively rich and those who are relatively poor are less likely to support him. Furthermore, economic insecurity is a huge factor – those who worry about their economic future are much more likely to vote for Trump. Rothwell builds on work by Raj Chetty and Nathaniel Hendren at Harvard to find that people in living in areas with weak mobility for kids from middle-class families are more likely to vote for Trump.

These findings are only the start of what is likely to be a long debate. Nonetheless, they support Hayes’s argument. People seem to be more likely to support an anti-system candidate like Donald Trump when they have a middling income, when they feel economically insecure, and when they live in places where middle-class kids have worse prospects for getting ahead.

Trump promises to reform a "rigged" system

The issues that Hayes talks about are at the heart of Trump’s political identity. Trump claims he is fighting against "special interests" that have "rigged our political and economic system for their exclusive benefit," describing Hillary Clinton as a "puppet" supported by "[b]ig business, elite media and major donors … because they know she will keep our rigged system in place." In the debate on Sunday, Trump kept referring to Clinton’s "friends" among America’s financial elite, insinuating that she had gotten rich through doing favors for them.

Of course, Trump isn’t the first politician to rail against elites. However, he is the first presidential candidate for a major party in recent memory to gain populist credibility because elites are lining up to rail against him. This likely explains why Trump’s core support — including some people who are not core Republicans — has been so impervious to attacks from traditional sources of authority. His supporters plausibly see these attacks as evidence that the corrupt establishment is targeting Trump because it fears he will really change things.

Trump’s life story — or, more precisely, his imagined life story — corroborates this mythology. He presents himself as a self-made man who has succeeded on his own merits, and skirts around the financial support he received from his father. If you want to return to an America where people succeed on their own merits rather than being done down by a rigged system, and don’t gag easily when asked to swallow dishonest brags, Trump might seem like the kind of candidate you want to support.

Hayes’s book misses one big thing

Hayes’s book describes how meritocracy is breaking down, and how American elites and middle-class people are increasingly disconnected from each other. He captures many of the fears and anxieties that are at the heart of the Trump phenomenon. However, there is one crucial factor that his argument doesn’t get — the role of racism and xenophobia. Hayes hoped in 2012 that discontented people on the left and right might find common cause in pushing for institutional reform. Although he wrote about how meritocracy is blind to inequalities of race and income, he had little to say about the relationship between anti-system anger and racism.

It is impossible to talk about Trump’s anti-system populism without talking about racism and xenophobia. Trump blames elites for what is happening to America, but he also blames people who are not white Americans. He uses vicious slurs against Hispanics and Muslims, and claims that African Americans live in self-made urban hellscapes.

But to point out the presence of tribalism in Trump’s appeal doesn’t mean that the decay of meritocracy is unimportant. People who say that Trump’s popularity is explained by racism and people who say it is the product of economic frustration, can easily end up talking past each other. Populist resentment mean that many people are looking for someone to blame, and systematic racism means that the targets of blame are very likely to be African American, Hispanic, and Muslim.

If we lived in a counterfactual world where US levels of racism were the same as they are here, but where people believed that US institutions were basically fair, it would be much harder for an anti-system politician like Trump to succeed, since he would have fewer angry people to whip up into a frenzy.

However, this does mean that Hayes’s hopes for a progressive coalition of angry populists from both left and right were almost certainly misplaced. Any crisis of belief in American institutions and elites that is big enough to have political consequences will almost certainly offer ample opportunity for people like Trump to mobilize white conservative voters beneath a banner of racism and xenophobia.

One useful point of comparison is the United Kingdom, where the new Conservative prime minister, Theresa May, is trying to turn the Brexit vote into a political opportunity for her party. In her annual speech to the Conservative Party convention last week, she offered a vision of Britain that would "build on the values of fairness and opportunity," creating a Britain "where everyone plays by the same rules and where every single person — regardless of their background, or that of their parents — is given the chance to be all they want to be."

May says that the biggest problem of unfairness is between the rich and powerful, on the one hand, and their fellow citizens, on the other, and that it is time to reject the ideology of the libertarian right and use government to correct unfairness and injustice. Her government also wants to close its borders to immigrants and shame businesses that employ foreign workers.

In short, the UK Conservatives are turning to a less bombastic version of Trumpism, in the belief that it will allow them to steal traditional Labour voters and build a winning coalition. Their formula includes both an acknowledgment that market competition doesn’t let people rise on their merits and an appeal to xenophobia. As the independent public intellectual Rich Yeselson has said to me in email, this is One Nation Conservatism — but for white natives only.

It is certainly possible that US politicians could mount a similar appeal, although US demographic facts would make it a much tougher climb. In four years, a more disciplined and intelligent candidate than Trump might be able to fill the market gap that Trump has identified, and expand his electoral coalition to include many moderates. It would be deeply unfortunate if Hayes were correct that the decline of the elites offered a major opportunity to remake politics — but if such an opportunity is only available to a torch carrier for the xenophobic right.

Henry Farrell is an associate professor of politics and international affairs at George Washington University. He blogs at the Washington Post’s Monkey Cage and at Crooked Timber.