When people perceive that their living standard is not improving, their earning is not rising, their careers are stagnating, that their children’s lives would be worse than theirs, that a decent roof over their heads is beyond reach, they will start to harbour resentment.
These resentments will be directed against governments, against immigrants ( some, instead of trying to adapt to the new country they settle in, try to impose their cultures and beliefs over the existing one in the new land), against establishments. Thus you have Brexit in the UK and voices in othe EU nations asking for similar referendum.
In the case of European Union, the fact that there are 28 decision makers each trying to fight for their own interests and agenda, it is difficult to form any real initiatives or consensus for economic advancement. As a result, the whole EU has stagnated for many years.
The EU has simply grown too big to be effective. On top of that, failures of countries like Greece and to a lesser extent Spain require channeling resources and wealth to support them from failing.
The original EEC 6 was much smaller and much more effective. Even after Britain and a few others had joined in the early 70s, it was still feasible. But when it grows to a membership of 28, it becomes too big and cumbersome and stagnation is inevitable. Imagine a company with 28 equal share holders each trying to have his/her say, this company is not going to go anywhere.
I think the UK may face some problems in the short terms, but once the pain is over, it will be much better for it to grow again.
It is not unlike that a patient who requires radical surgery and who may suffer in the short term, but will become healthier once the short term effect of radical surgery is over!