People didn't much participate in politics anymore outside of the party zealots because it was all the same. Voter apathy made Cameron feel confident enough that not enough people would vote in the referendum and if they did they would all vote remain anyway.
He outsmarted Farage at that point and made UKIP obsolete.
But here's the thing. The recession had also hit Britain hard and some industries, towns and public services, much like elsewhere in the western world had been completely decimated.
Jobs have really moved to China, Poland and other countries. EU regulations have really made part of Britain less competitive on the global market. And austerity is at the center of all of these problems.
Cameron had counted on Farage to run a 'radical' leave campaign. But he didn't expect as many other politicians to run a leave campaign as well, most notably Boris Johnson. Who considered this an opportunity to prepare himself for a challenge against Cameron for the party leadership and end austerity. As soon as this happened Brexit went global. Politicians like Merkel and Obama started to 'interfere' and started giving out their opinions on how the UK should vote. Further fueling the anti-establishment sentiment.
On this backdrop the voters expressed their anger and they did so by voting to leave the EU. A vote against all the bankers, politicians and elite who told them to vote remain. And tons of people who hadn't voted in a long time and haven't voted since voted in the referendum to leave the EU.
Globalism has really left a lot of people, mostly the lower educated in the cities behind. Families that lost cars, homes and relationships that were formerly part of the 'middle class'.
Leaving the EU was a big middle finger to the political establishment that had ruined them.
Bailing out the middle class of America and Europe would've been a 'drop in the bucket' so to speak but governments the world over choose to ignore the plight of their citizens and only save the institutions and corporations.
After all real political power came from those institutions and corporations and not the voters at the ballot box.
Boris, Farage and friends made a critical miscalculation as well. They figured that Cameron already had a plan in place in case the people would vote to leave.
No one ever anticipated he would simply walk away so no one ever gave any thought to what a policy on leaving the EU would actually look like.