During the six months leading up to Britain’s referendum on whether to stay in the European Union, the many politicians and strategists on the “Remain” side tended to assume that victory was assured. Indeed, near the end of June 2016, with only a day to go before the big vote, one of the most senior behind-the-scenes figures in the British government was so brimming with confidence that he later recalled the weather that day in London as “balmy and cosmopolitan.”

The populists who were making the case for Brexit had plenty of passion, a fiery rhetoric about immigration that resonated with millions of voters, and a set of romantic ideas about the United Kingdom as a buccaneering global force. But so what? Led by then–Prime Minister David Cameron, the Remain campaigners told the public that leaving the EU was a huge economic risk that would make the average British household worse off by £4,300 a year (at 2017’s post-Brexit exchange rate, about $4,940). As Cameron’s communications chief, Craig Oliver—the man who divined triumph in that early-summer warmth—puts it in his new Brexit memoir, there had been no British election in over 100 years “where people have voted against their direct financial interests.” Under the leadership of Cameron and his aides, everything the pro-EU side did followed from this single article of faith.

They also had the polls on their side. Most seemed to suggest that this approach was justified. Thus, even on the night when the result was announced, many in the inner circles of power believed that Britain would vote to stay in the EU. Jim Messina, the former Barack Obama aide who was helping Cameron’s Tories on the campaign, assured anyone who would listen that his modeling said the vote would go in favor of Remain by 52 to 48 percent. People in charge of London hedge funds were also saying much the same. Oliver’s book records Cameron, at an official reception where guests were served moussaka and lasagna, “looking relaxed in a casual navy-blue shirt that [wasn’t] tucked in.” This insouciance was Cameron’s way: In 2012, an authoritative biography reported that “if there was an Olympic gold medal for ‘chillaxing,’ he would win it.”

But in the early hours of June 24, it was clear there was little to chillax about. The political roof had caved in, and Cameron’s career would soon come to an abrupt end. In an augury of Donald Trump’s upset in the fall and the wave of illiberal forces spreading throughout Europe, it became clear that the “Leave” side had narrowly won out, by pretty much the exact reverse of Messina’s figures. The pollsters had been wrong. So had most of the politicians.

Since then, the UK’s politics has been in a state of ferment, as a party system built on old political divisions has been thrown into disarray by two cleavages now revealing themselves across the Western world. The first is generational, as evidenced by the fact that among Britons age 18–24 who voted in the referendum, 73 percent supported staying in the EU, versus the 60 percent of voters 65 and older who supported leaving. The other is economic and social, and it often divides along geographic lines as well: between the kind of affluent, liberal, city-dwelling people who supported Remain, and the more conservative supporters of Brexit, many of whom live outside London and believe that globalization and the liberal elites in charge of its implementation have failed them (and whose disappointment over the past several decades sometimes blurs into xenophobia and racism, not least when it comes to questions of immigration).

These cleavages are perhaps not as new as many think. “Open” and “closed” ideologies—­which can be found in both right and left varieties—have been brewing for at least a decade in Britain, and bring with them unsettling new kinds of politics. On the left, these divisions threaten to sideline traditional questions of economic equality and redistribution and sever a once-dependable relationship with the working class, which at one time was taken to be the vanguard of progressive change but has since been recast as the base of a new conservatism. The right, therefore, has the chance to acquire a sizable and voluble group of voters. But many conservatives are also keeping their celebrations to a minimum, for one reason above all others: Right now, the “closed” side has the advantage, and as the rise of Trump and a protectionist right proves, this new wave of populist reaction threatens the decades-long dominion of free-market economics and unfettered trade.

In Oliver’s recollection, Cameron emerged the morning after the referendum to issue an almost absurdly glib verdict: “Well, that didn’t go to plan!” From the perspective of politicians of a certain generation and background, the same might be said of just about every major political development since then, a turn in politics captured by an image that is the convulsive mood of 2017 incarnate: On a US visit arranged with indecent haste, Prime Minister Theresa May—whose catchphrase has become “Brexit means Brexit”—was caught in lockstep with Trump, who saw fit to take her hand and hold it tight.

Britain, the United States, and the wider Western world are clearly in the midst of a new kind of politics, characterized by hostility to international arrangements and institutions—from trade deals to the rights of refugees to NATO and the European Union—and the idea that a new “post-­liberal” epoch may have dawned. Even though he was among this new era’s first casualties, Cameron seems to have had some idea that the EU referendum might herald its arrival. At some point in 2015, he ran through the pros and cons of allowing the British people a vote on their country’s place in Europe—and on the negative side, he summed everything up in the sentence that gave Oliver his book’s title: “You could unleash demons of which ye know not,” he said. As it turned out, he was painfully right.

In Europe and beyond, the center-left’s crisis is manifested in tumbling vote shares (one recent poll puts the UK Labour Party’s support at a low of 24 percent), lost elections, and a sense that the social democracy of the 20th century has precious little to offer the 21st. What is often missed is a matching malaise on the center-right, and what it means for the free-market politics that has held sway across a huge swath of the world since the early 1980s.

No figure embodies this more than Cameron, who served as prime minister between 2010 and 2016 and has barely been seen since the referendum. With echoes of the “compassionate conservatism” that was briefly in vogue in the United States before 9/11, he won the leadership of his party in 2005 by promising to reinvent the Conservatives as a socially concerned, environmentally responsible force that would somehow sideline its old reactionary elements; become newly open to LGBTQ people and ethnic minorities; and direct some of its energy toward addressing inequality, poverty, and such modern concerns as the balance between work and family life. To some extent, Cameron was successful: Among the examples of this new approach coming to fruition was his first government’s introduction of same-sex marriage legislation. But on questions of economics and the state, Cameron proved to be an orthodox free-market Conservative with a depressingly familiar set of beliefs.

His six years at the top—five of them spent in coalition with the centrist Liberal Democrats—were dedicated to rolling back the traditional welfare state, declaring war on the regulation of business, attacking public education, and talking endlessly about the imperative for Britain to somehow win what he called “the global race.” As with just about every Conservative politician of his generation, his ideas harked back to the 11-year rule of Margaret Thatcher. But they also had strong echoes of Tony Blair, the Labour Party prime minister who arrived in office affecting to be a moderate social democrat, but who quickly revealed himself to be a Thatcherite in all but name. Cameron styled himself as “the heir to Blair,” and some of his aides and allies referred to Blair as “the master.”

The bitter resentment expressed in the Brexit vote often seemed incoherent and emotional—but as much as anything, it was this stifling consensus among the ruling elites of both the left and right that millions of Britons rebelled against. To some extent, rejecting the Blair-Cameron approach by voting for Brexit made sense: The European Union, after all, had enthusiastically embraced the same free-market, pro-globalization ideologies, issuing directive after directive mandating member countries to open up their economies, and insisting on the free movement of capital and workers. The EU is, of course, a distinctly two-faced institution: Parallel to its neoliberal policies, it seeks to tame international business and enforce some regulations that protect workers from exploitation and harm. But in recent years, especially since the 2007–8 crash, the EU’s neoliberal side has won out, creating a serious political backlash.

In the UK, a lot of the hostility toward Europe has also been based on high levels of immigration from EU countries, and the fact that what the official vocabulary of the EU calls the “freedom of movement and residence” has always been tangled up in the issues surrounding low wages, job insecurity, and inadequate public services. Indeed, a whole chunk of the British economy has become dependent on workers from countries like Poland, Latvia, and Lithuania, who will take jobs too poorly paid and insecure for most Britons, but that provide a precarious living for people from places where wages and conditions are even worse. The anger this has kicked up is often unsettling and sometimes downright hateful—but it is real, and it has come to sit at the heart of life in scores of British towns and cities.

When the Conservatives decided to call the EU referendum, in part as a response to this growing fury, the dangerous political consequences should have been all too clear to Cameron and his allies (there are obvious echoes of Hillary Clinton here). But moving only in the most elite circles, how could they have known? Cameron is an alumnus of Eton College, the boarding school that is a byword for the English ruling class; his home turf is the Cotswolds, a famously affluent part of the UK countryside; and he has spent much of his life in and out of power surrounded by many other people who are just like him.

Oliver arrived in Cameron’s orbit in February 2011, taking the job as the prime minister’s director of politics and communications after a shining career at the BBC. One of the most telling chapters in his book recounts a visit to the World Economic Forum at Davos, Switzerland, in January 2016, where he and Cameron kept company with the likes of Sheryl Sandberg, the chief operating officer of Facebook; Bono, the rock star and global philanthropist; and Tony Blair. The most useful advice he received came from Richard Curtis, the writer of such English movies as Love Actually and Four Weddings and a Funeral. Curtis told Oliver that as far as he could tell, precious few British people had any understanding of the European Union “or how it impacts on their lives.” This was undoubtedly true— but the fact that Oliver was alerted to this “key problem” at a sealed-off event in an exclusive Swiss ski resort speaks volumes about the elite’s own woeful distance from the world of working-class people in Britain.

When the referendum campaign began in earnest in the spring of last year, the Tories’ lack of connection with much of Britain was reflected in the Remain side’s tactics. Two months before the referendum, Obama visited London—and, at a joint press conference with Cameron, warned that if the UK left the European Union and sought a new trade deal with the United States, it would find itself at “the back of the queue.” Oliver recalls his instant reaction to this warning, and how he assumed it would play with voters: “The news is a dream. We couldn’t have hoped for more.”

The people campaigning for Brexit, by contrast, were sure that Obama’s intervention had actually damaged Remain. According to subsequent reports, people in their focus groups repeatedly used the phrase “none of your business” and thought that Obama’s threat was “really bad.” Once again, Cameron and his inner circle had fatally misjudged the public mood: They were completely taken aback by the idea that such set-piece stunts involving popular foreign politicians—even ones as sainted as Obama—would more likely backfire than lead to any political dividend.

The sense of millions of people implacably set against Cameron and his agenda had one particularly piquant aspect. Just as Trump’s path was opened by the reactionary turn taken earlier by the very Republicans who affected horror at his rise, so Brexit was at least partly the result of the long-standing tilt of British Conservative politics toward anti-Europeanism and the cynical exploitation of worries about immigration.

In 2010, Cameron had made an impossible pledge to reduce net migration to Britain to “the tens of thousands”—but just before the referendum, the figure was put at 333,000, and he was thereby hoist by his own petard. As for his rhetoric on the EU, Cameron frequently fell into the traditional Conservative habit of demonizing it as a bureaucratic nightmare, collectively set on the creation of a multinational superstate.

“I have no romantic attachment to the European Union and its institutions,” Cameron said in 2015. “I’m only interested in two things: Britain’s prosperity and Britain’s influence.… When we joined the European Union we were told that it was about going into a common market, rather than the goal that some had for ‘ever closer union.’” This was much the same rhetoric used by those politicians who had long campaigned for Britain to leave the EU. So when Cameron suddenly started attempting to extol the wonders of Britain’s membership, their comparatively clear and consistent voices drowned him out.

The immensely complicated process of negotiating the UK’s exit from the EU is set to begin this spring. Some projections of the effects of Brexit on the UK economy suggest the cost to Britain’s GDP over the ensuing 10 to 15 years could be as much as 10 percent. Even the government’s own fiscal advisers have warned of adverse effects on growth and the prospect of increased government borrowing. Such, perhaps, are the consequences of culture and identity taking political precedence over economics.

Theresa May, Cameron’s successor, is seemingly attempting to combine two contradictory political approaches: paying lip service to open markets and free trade, while also pointedly embracing some of the nativist populism that is running riot across Europe and the United States. When the Tories gathered for their first annual conference after the Brexit vote, May’s ministers announced plans to force companies to make public the number of workers from overseas on their payrolls, and to minimize the number of foreign doctors working in the British health-care system. Her big speech at the same event underlined the sense of a new turn in Tory politics, as she attacked the very people with whom Cameron had been most associated: “people in positions of power [who] behave as though they have more in common with international elites than with the people down the road, the people they employ, the people they pass on the street.” The Davos class, it seemed, was in her sights—and one of her payoff lines nailed this sentiment in a single sentence: “If you believe you’re a citizen of the world, you’re a citizen of nowhere.”

May is a subtler politician than some of her words might suggest, but that line alone highlighted her basic political calculation: As also proved by her hasty trip to see Trump, she wants to capitalize on the rise of the “closed” attitudes crystallized by the Brexit vote, rather than go the way of Cameron and be consumed by them.

On the British left, in the meantime, many find themselves under siege. Labour’s Jeremy Corbyn talks about tackling the fundamental economic problems that he believes created the conditions for the “Leave” vote: low pay, poor public services, an erosion of social protections. But his politics can’t get a satisfactory public hearing, partly because Corbyn can’t speak convincingly to the elements of the public mood bound up with national identity, and partly because many people’s ongoing skepticism about immigration is not satisfied by his refusal to take any clear stance on the free movement of people. It may also be about geography and class: Corbyn is, after all, almost as much of a metropolitan liberal as the centrist politicians he tries to define himself against, and he is equally disorientated by how the country’s politics has shifted.

Moreover, he and his party are tortured by the way that Brexit has exposed a potentially fatal crack between the two halves of the left’s longtime political coalition: the traditional working class and metropolitan, middle-class progressives. For fear of alienating the working-class people who voted “Leave,” the Labour Party has stated that it respects the referendum result and will do nothing to impede Brexit—much to the fury of many of its more affluent city-dwelling members, who are often passionate EU supporters.

In just about every Western country, progressive breakthroughs are almost always the products of alliances between these two groups of voters. This was certainly true in Britain’s past, as demonstrated by the iconic Labour government elected in 1945 and the coalition of manual workers and middle-class voters who were attracted by its promises of social reform and economic planning. It was also true for much of the postwar history of the North Atlantic, where coalitions of working- and middle-class people helped build robust welfare states.

But how are the left and liberals to rebuild this alliance in the wake of such a terrible divorce? Will a new “progressive” politics have to weaken its attachment to internationalism and the free movement of peoples? Will electoral success demand some new emphasis on national boundaries and identities? Such a strategy may well lead the left dangerously close to the kind of nativism and nastiness that defines the populist right, so perhaps the best thing to do is to take a deep breath, hold firm to internationalist values, and fight. As things stand, though, those values face no end of challenges.

Meanwhile, David Cameron is apparently adjusting to a kind of early retirement, newly able to chillax as much as he wants. He made his last speech as prime minister on July 13, 2016, outside the official residence he had just vacated, dutifully observed by Oliver, who was also on his way out. “When he was done,” Oliver writes, “he and his family turned to get in the cars that would take them out of Downing Street for the last time, and he turned to wave to us. I thought, I hope history will be kind to you.” That seems a vain hope: Ten months after the referendum, Cameron looks increasingly like an embodiment of the age that he helped bring to an end by failing to grasp the great furies gripping the Western world. He took the gamble of his life, and it destroyed him.