Prime Minister David Cameron — then-head of the Conservative Party, also known as the Tories — had been facing a lot of guff from his right flank over the UK's membership in the European Union, especially when it came to migration. In part to quiet the ranks, Cameron promised that if the Tories won the general election in 2015, the UK would hold a referendum on EU membership. They did and so they did!
(If you want a recap of that whole debate plus some Harry Potter GIFs, here you go.)
The short of it is that in a shocking surprise, the Leave campaign won out over the Remain crowd by a narrow 52% to 48% vote. Cameron resigned the next day and could be heard humming cheerfully as he walked away from the whole mess.