They just crossed the line. Very tight race in the end.
Polling in the UK has indicated that the populace thinks leaving the EU was a poor choice for a long time.
Even people who voted Brexit, at the time, were mostly in favour of having a strong relationship with the EU by staying in the customs union. Most even thought freedom of movement was a fair price to pay for a close trading relationship. Seriously, look up the things even Nigel Farage were saying in the run-up to the vote. That he’s not asking we leave the customs union, that our relationship would be close, etc.
It was only in the months after the vote that Brexiteers became more and more separated from reality… their words went from “we can have a relationship like Norway, who isn’t an EU member but is still majorly involved and very close” to “let’s ignore the EU and completely cut them off”. Because that’s what happens when you give right wing populists an inch. They will then take a mile.
It should also be noted that the UK is far from alone in this. Around the time of the 2015/2016 Syrian refugee crisis, anti-EU sentiment was at a high all over the union. The UK was only the 2nd-4th most anti-EU country in the union, depending on the study. If more countries had a referendum, more would’ve left.
The UK did it because David Cameron (PM) was worried about the growing influence of Farage. He called the referendum, expecting Remain to win, which would then cause a collapse in support for Farage/UKIP (who were taking votes away from the Tories).
Each and every country in the west seems to have a sizable populist far right movement these days. In some countries they’ve even been getting into government recently. I fear we have dark times ahead, because it seems to be a hard issue to tackle.