We talk about the European Union as if it were one thing, but it really isn't just one thing. It's a number of overlapping treaties that each affects a different set of countries. Overlay that with other treaties and agreements, and you get quite a complicated picture, shown here in a graphic from Wikipedia (original here for easier detail viewing):
If you include NATO, OSCE, and the UN, it gets even more complicated (original here):
I'll end with this diagram of the overlapping areas of the United Kingdom, the British Isles, Ireland, the Crown, etc. (original here):
People and our organizations are complicated!