"Next question, since the EU is built on the idea of a common market"
A (sadly) very common misconception. The EU is built on the idea of political union to prevent war, achieved through the mean of a common market that makes its members interdependent.
See its founding document, the Schumann Declaration:
https://europa.eu/european-union/about-eu/symbols/europe-day/schuman-declaration_en
The UK having been involved in the same wars as France and Germany for pretty much its whole history, it's really sad only the market aspect seemed to matter there :/