the basic legal structure of the EU works like this. The EU does not create laws, it creates what's called directives. National governments are bound to create domestic laws implementing said directives. the EU has the mandate to overrule nation states on what to do but not how to do it, and in reality the system leaves national governments quite a lot of leeway, intentionally. (The EU also can create 'regulations' which are directly binding, comparable to an act of parliament)
And the EU also has mechanisms to impose penalties for countries that fail to comply, but in practice this is rarely done for political reasons.