Well, what happened is this:
A Conservative government with a weak grasp on power noticed that a lot of "poorer people" were unhappy with their situation - low benefits, poor employment prospects, a stagnant wage that equated to pay cuts over the years, an inability to afford housing or to save for retirement - and knew a popular scape goat could be "foreigners". This is an age old tactic; blame the "outsider". People are susceptible to this type of thinking, especially in populations that have been subject to the sort of problems described, and who tend to have few personal relationships with "foreigners". They're easy to see as a concept, and harder to see as individual people with the same desires as all of us.
The Conservatives decided that they could harness the plight of these people by claiming their problems were caused by the EU. It was easy because ever since the EU was formed there had been right-wing nationalist media frothing at the mouth about it. So, people were used to the EU being blamed for everything, it was a constant undercurrent in popular media for decades. It sounds silly now, but people got mad about the EU for things like dictating how bent a banana must be. It was a lie at the time, a misrepresentation of the truth, but it didn't matter. Thats what people were used to hearing and they didn't bother reading details - they just took the headline and believed the hype. So, when politicians started to say that immigrants were why people suffered, they believed it. And when politicians said the EU made them accept immigrants, they believed it. It was never true. But, in these times, truth didn't matter. Have a look at the utter bollocks Trump said vs what he did. That's the degree of insanity there was.
So, the Conservatives decided to hold a referendum - to decide whether people wanted us to be in the EU or not. They didn't expect us to come out of the EU, they thought sense would prevail because they believed most people from "more educated backgrounds" knew the benefits of EU membership and would out-vote the poorer people - but it'd be a token gesture to the poorer people to get them on their side. "We gave you the choice". They thought it'd secure their leadership. It was an attempt at populism.
They were so sure of this outcome that they made no plans whatsoever for if the vote went the other way and Britain voted to come out of the EU. The only concession to this idea was that the referendum itself was non-binding. Which was a safe guard so that, if the unthinkable did happen, they could argue that it was not in our interest to exit the EU and the vote could be ignored. That was wise.
The whole debate was full of lies, victim blaming, and grandstanding. The leave campaigners were far louder and better heard than the remain groups - I saw many leave placards here in wales, and not one remain. There was incredible hubris about it.
The conservative party was horribly out of touch. They didn't realise the depth of feeling created by a decade or two of British politics letting the poor become poorer and the rich become richer. The vote did go the wrong way.
The Prime Minister resigned. A woman who no one voted for was put into power; she switched from being a Remain campaigner to a hard-line exit stance. She tried to play hardball with the EU. She claimed that the 51.9% of the vote was a "clear will of the people", and did not bother to argue that it was a very slim victory based on a campaign of provable lies. She didn't bother with the safety net of a non-binding vote. She didn't care that it was only 26.7% of the UK population as a whole voting to leave. She abandoned her duty to protect the UK's interests - even against themselves - and instead marched onward with what she felt would secure her political advantage.
Meanwhile, the opposition party tore itself apart. Unable to get behind their leader - who was voted in with unprecedented support - they imploded and sabotaged themselves. All the while they laid the blame on Corbyn. Their actions made Labour unelectable, but they fooled themselves into thinking it was Corbyn who was unelectable, not them as a party. Thus, the Conservatives - who should have been eviscerated by Labour - got away almost entirely unscathed.
At the same time, the unthinkable happened with our closest ally - a right wing white supremacist nationalist with no experience in politics became president of America. The UK had painted itself into a corner. We'd been alienating the EU thinking we'd be fine, and then America essentially went rabid on us; and we were forced to choose between supporting a monster with severe indications of Hitler-esque policies and viewpoints, or tucking our tail between our legs and apologising to the EU and the poor population that voted to leave it...
Politicians didn't have the backbone to do the moral thing. They were afraid at how unpredictable and powerful that group had been the last time they messed with it. So May triggered a hard brexit. No planning was in place. No safety nets. Just a mad gamble and more vague promises of future prosperity and posturing as confident.
Our health service was defunded to the point on breaking. The poor no longer had free healthcare. They also had less benefits, the country "couldn't afford them". And everyone was poorer because the pound was worth a lot less than it had been, we couldn't buy things from abroad anymore. So the price of everything went up, making the poor more poor.
Immigrants not only received harsher treatment by government, they simply didn't want to come here anymore; we didn't offer the better pay we once had, or the better way of life, or a nice culture to join. So we lost people who had been propping up the care services, and the transport services. And British people did not fill those ranks; there were not qualified British people available. There never had been, because we hadn't educated those types of people, and those types of people didn't want to work those types of jobs for that level of pay.
Then, Scotland voted to leave the UK. It was obvious that would happen, and May knew it - she tried to argue the opposite of her Brexit stance to Scotland even though it was essentially the very same issue. It failed, Scotland left, became a fully independent country, and filed for membership of the EU.
The UK dissolved, it could no longer prop itself up with the financial markets that had been the power house for decades after manufacturing died. Banks left, money left, and we were left with colossal debts that were worse than WWII. And this time we were not victors in a war, and were unable to bring manufacturing to bear to create new wealth.
At the same time, automation was killing jobs. Cars could drive themselves, doctors were being out-performed by AI, labour in warehouses was being replaced by robots. Huge swaths of people became unemployable right at the time when benefits were at a historic low, and the country was historically poor.
And now, we are here. This is why so many people are dying of ill health now. It's why life expectancy has dropped for the first time in decades. It's why life is more miserable than I can remember. It's why there are more racists and more violence on the streets. It's why no one owns their own home anymore. It's why we have to work until we drop dead. It's why we have no opposition to those in power.
The lesson is this: never trust any one source of information. Mix with people unlike yourself. Learn about them. See them as people. And never, ever, let anyone get away with lying to you. Be suspicious of anyone offering you simple answers to heartfelt problems. They are manipulating you for their own advantage.