Remainers did not grasp the fact that immigration was the issue for a great number of the working class who haven't seen the benefits of HMG's economic programme. The working class have seen deterioration in the services that HMG provide and blame immigration. Farage and his demand to get back control into elected hands (despite not being elected himself) showed closet becoming open bigotry and lies but hit the sweet spot.
I think this is the most likely explanation
It was always a stupid referendum to hold, but I was never aware of Europe be a burning everyday issue. It was an issue that preyed on the minds of the political sure, their everyday work was more directly affected by it, and for that reason Cameron assumed that it was more prevalent in the publics list of priorities than it was. I think there was also en element of people not having ever recovered from the recession, and that they could well have adopted a 'what have I got to lose' attitude. The so-called economic recovery was largely confined to certain industries and certain parts of the country, with huge swathes otherwise by-passed. I'd been concerned for years that data was presenting a rosier picture than that which was actually there and a smug London based Westminster were patting themselves on the back for achievements that barely existed
It needs to be acknowledged though that this was a long campaign, and there was no shortage of information. The people can't say they've been 'put away'. I do believe however that its been drip feed process that's run for nearly a decade and in that regard Cameron played more than his fair share in posioning the well both in opposition and in government with his continual cheap shots, undermining of Europe, and mixed messaging. Take an area like immigration which is being clearly cited. It's very difficult for the Prime Minister and his supporters to say that its down to xenophobes etc when only a few months he was describing immigrants as "swarms" and making statements like this "That bomb in Paris, that could have been London. If they had their way, it would be London. I can't stand here and say we are safe from all these threats. We are not". How does he expect people to react when this kind of thing is being drip-fed into the public conscience?
In a similar vein Cameron has been sniping at Europe for years. In opposition he was continually mocking policy areas like The Human Rights Act, Health and Safety legislating and of course The Euro. He happlily employed and laughed along at a Foreign Secretary that described the French as "cheese eating surrender monkey's". It's all corrosive, but you sense the direction of travel started to really change with the Euro crisis and confidence in Europe never recovered
Cameron will doubtless go down as one of the worst Prime Ministers ever (certainly in modern times) but we'll see how it pans out now. It needn't be all doom and gloom, but the UK desperately needs Donald Trump to win in November now (the Americans are going to be livid now that they've lost their European Trojan horse). Personally I'm not as fazed as others, but I can conceed that the decision instinctively feels wrong. I wouldn't be shocked if there's armies of civil servant desperately working on recovering this situation now that the latest politician has caused another right mess for the to try and patch up.
My big fear is just what a succession of right wing conservative governments are capable of visiting on us as a country without the back stop of European legislation, albeit we will need to adopt much of this in order to retain access to the market anyway. Oh well, I've got a whole load of price cuts to process now as sterling drops to a more advantageous level