It's mostly, so far as I understand it, a nativist movement. There are other considerations and not everyone who supports the Brexit is a nativist, but that's mostly the genesis. Members of the EU can live and work in any other EU countries, and so there's been a surge in immigration to the UK. Others in the UK believe the EU holds them back economically, but I'm not sure there's a lot to support that. Vox's explainers are good: Brexit: updates on Britain's vote to leave the EU I think we have people on these boards who live in the UK and I'd love to know their opinion and if I'm close to right.
Caveat, I haven't actually read any in depth articles, but my impressions... It's the same sort of thing that is happening here. Is Isolationism good policy or not. As a member of the EU the UK has to follow policies that the EU as a whole has decided upon. Some of them get people upset, like policies regarding economics and immigration. While the EU model is not the same as our "United States," the mindset to why it is a good idea is similar to some of the secession talk that gets thrown around, commonly in Texas. "Taking the UK back" being similar to "Making America Great Again." As to the timing, it's spillover from the financial crisis (Greece / Spain economies) and the situation in the Middle East / Terrorism / refugee crisis. People are feeling like the world is out of control, and are desperate for a solution.
As ECDC said, it is basically Great Britain's version of Trump's "America First" agenda. What I find amusing is the Brits think Americans are totally out to lunch when they are just as bad.