Originally, the EU and NATO coexisted with separate goals--the EU worked on economic integration, and NATO dealt with defense.
Member states have been reluctant to cede control in foreign policy matters.