A European Union flag, with a hole cut in the middle, flies at half-mast outside a home in Knutsford Cheshire, Britain. (Christopher Furlong/Getty Images)

Late Thursday night, voters in the English city of Newcastle chose to remain in the European Union. Pollsters had predicted that voters there and elsewhere in Britain would have voted Remain by a considerable margin. In the end, Remain won by the tiniest of margins, taking 50.7 percent of the vote in Newcastle.

Over the next six hours, results from across the United Kingdom showed that British voters were tearing up the script and starting again. Not only did they turn out to vote at higher rates than in any previous U.K.-wide referendum, they also voted to Leave at higher rates than most had predicted. In the end, almost 52 percent of voters chose to exit the European Union.

Before we move on to discussing the consequences of this shock vote, it’s important to think about what this says about our ability to predict, and render intelligible, referendums of this kind. There are four main points to make.

First, we did not see this coming. For some weeks now, Stephen Fisher and Rosalind Shorrocks have been tracking referendum forecasts. They consider a wide range of sources, from forecasting models based on polls, to citizen forecasts, to betting markets. None of these methods saw a Leave outcome as the most likely outcome. Ordinary citizens came closest, putting the probability of ‘Brexit’ at 55.2 percent, closely followed by an average of polls at 55.6 percent. The least accurate forecasting method was to infer probabilities from betting markets. Fisher and Horrocks, on their morning of poll update, reported an implied probability of just 23 percent. Ninety minutes after the close of poll, this market-derived probability had fallen to just 11.3 percent.

Second, this was not a systematic polling failure of the same magnitude as last year’s U.K. general election, where opinion polls badly underestimated the Conservatives’ chance of victory. There are very many ways to combine polls, but a simple average of the last poll released by each polling company predicts that Remain would get 51 percent, three percentage points off the final result. Three of 10 polling companies published final figures which were within the margin of error of the final result. Two of these companies conducted their polling online, and generally online polls — which had provided lower figures for Remain throughout the campaign — were more accurate. Although the polling industry would have preferred to have nailed it “on average,” they have not performed as badly as they did last year, and remain acutely aware of the potential ways in which their polls can fail.

Third, we learned something about campaign dynamics in referendums — and we went wrong by believing too firmly in a claim about how voters decide. Part of the disparity between relatively close polls and relatively confident betting markets was due to the belief in status quo reversion — the idea that undecided voters will be more likely to choose the status quo option (in this case, Remain) than the alternative. This tendency is well supported — but as Steve Fisher and Alan Renwick have shown, this effect seems to be smaller in referendums which have been closer. It seems that no such effect was present here. That may either be because the effect is weaker than we thought it was, or because the Leave campaign was successful in creating the idea that a vote for Remain was not a vote for the status quo, but rather a vote for ever more European integration. These rival interpretations will only be settled when academic research on referendum voting behavior is released in the months to come.

Fourth, given the types of areas that voted to Leave, and given the available polling evidence, it seems likely that a majority of Britons have traded economic benefits for restrictions on people from the European Union coming to live and work in Briton. The areas which voted Leave were older, whiter, and less likely to have a university education. I’ve already cited Fisher in support of many claims, but a blog post of his from three days before the referendum bears repeating:

If people were forced to chose between accepting free movement as a price of free trade in the EU, or abandoning both, the contest would be close. But many do not think they face such a trade off. One poll shows 57% of Leave supporters believe that if Britain left, “it would probably be possible for Britain to negotiate free trade with the rest of the EU, without having to allow EU citizens to live and work in Britain.

We don’t yet know what United Kingdom will be able to negotiate with the rest of the E.U. Indeed, we don’t know whether the United Kingdom is still united. Majorities of voters in Scotland and Northern Ireland voted to remain part of the E.U. Brexit has materially increased the probability of a second independence referendum in Scotland, and is also likely to exacerbate tensions in Northern Ireland. Neither Scottish independence nor a unified Ireland are “most probable” outcomes: but then neither was Brexit.

Chris Hanretty is a Reader in Politics at the University of East Anglia.