What could be the reasons that small countries in Europe are considering to join the EU?

What could be the possible reasons why a member country of EU such as U.K. is considering seriously to walk away from EU?
What could be the reasons that small countries in Europe are considering to join the EU? What could be the potential benefits for them and what could be the potential loss if they do so?