The EU referendum has been another bruising night for the big pollsters, many of which were predicting a narrow win for Remain. Leave won by 52% to 48%, the reverse of the final poll by YouGov, released at 10pm on voting day. Turnout was nearly 72%, or 30 million people, better than anticipated.

Once again, the polling industry will ask itself: what went wrong? There were months of soul searching after the general election polling — which implied a hung parliament, but a Conservative majority was produced — and the search, it appears, goes on.

Pollsters often point out that they are barometers not forecasters; they simply capture the mood at a given moment in time. But there is no escaping that they were once reliable predictors of future events in a way that no longer appears to be true.

Peter Kellner, chief executive of the polling firm YouGov, tweeted early in the night that he was sticking with a central prediction of 54-55% in favour of remain. "Looking much closer now; remain victory no longer certain," he tweeted an hour later. As the result became clearer, Kellner wrote: "Seems we are heading for a result bad for UK, bad for pollsters and (least important) embarrassing for me."

"The trouble is, so many of us looked at the numbers and I just don't think we believed our own numbers," said Ben Page, chief executive of Ipsos MORI, whose last poll also had it at 52% for remain and 48% leave.

Page said pollsters have to make a number of difficult judgment calls — such as the likely turnout from each demographic — on which they model their raw results. For example, older, poorer and less educated voters tended to leave; the opposite to remain. Accurately gauging who will turn up to vote and in what numbers is tricky.

Remain's showing on the day was weaker than anticipated, particularly in traditionally strong Labour areas, such as Liverpool, for example, where 58% of voters backed remain against expectations of somewhere in the mid-sixties. Page said this is mainly reflective of two things: deep concern about the impact of mass immigration from the EU on wages and public services and a rejection of elites, most of which pushed hard for a remain vote.

Brexit Nigel Farage
Ukip leader Nigel Farage (3L) speaks during a press conference near the Houses of Parliament in central LondonGlyn Kirk/ AFP

"They're p***ed off. They're utterly p***ed off. And they have now actually gone to the polls and voted," he said. "They were cross enough to do it. We should have seen it. But we just do what we can. Some of our raw data was closer to a very small remain lead. But I think we were all mesmerised by Scotland, by the general sort of received wisdom, and it just goes around and around."

"I guess what we've totally underestimated — journalists, pollsters, politicians — is the scale of resentment out there, particularly in some of these market towns up north like Wigan, Burnley, Bury, places like that," said Keiran Pedley, research director at GfK, a polling firm.

"I suppose all the conditions were there for Brexit, maybe we were just ignoring them. Immigration is the number-one issue facing people. When you ask them about their own personal finances, about half said they didn't think Brexit would make any difference. So either they weren't heeding the Project Fear message, or they were in these areas where the felt well the economy's not working for me anyway, how could it get any worse?"

There was also a significant chunk of undecideds right up to polling day. Usually, undecideds tend to the status quo in referenda rather than risk upheaval and change. "People tend to stick with what they know," Page of Ipsos said. "In this case, they're clearly cross enough not to, which is fascinating. It's still not a huge victory for leave, but the problem for the markets is it's so against expectations and polls will be supped — if at all — with a very long spoon in future."

Not all of the polling was wrong. Some of the smaller pollsters conducting online research were right. TNS and Opinium both had leave in the lead in their final polls; the former by two points and the latter by one. "A lot of people are going to obsess over the big names getting it wrong," Pedley said. "Well a lot of them did, to be fair, but some of them didn't. We'll have to look into why that is."