You missed the point. How do you know that it was membership in the EU and not membership in NATO that deterred aggression? NATO predates the EU by a long time and there hasn't been war between NATO members or military aggression by a non-NATO European country against a NATO European country. A non-aggression pact without NATO enforcement is easily broken.