The EU treaty has a clause that calls for assistance for part of the members (who are not neutral) but there's no military structure outside NATO.
There's also a perpatual public debate about whether EU should become a military alliance. eg https://theloop.ecpr.eu/can-the-eu-form-an-autonomous-milita...
In practical terms, in event of a invasion, only NATO has a organisation set up for coordinated response.
There are four different mutual defense pacts in Europe and there is an umbrella one and they all operate independently of NATO. And then there is NATO, with or without the USA.
I assume the contradiction you refer to is that EU has this clause but it's still not considered a military alliance? Maybe you read the term differently. It doesn't mean it has zero defense dimensions, it's that its mission or capability are not military. That's why NATO is the one a would-be invader needs to worry about wrt military consequences.