Instead of the political decision of a bunch of unelected Brussels would-be "elites" which would never pass a general referendum. If they ever had such things, which they generally don't.
Would we call a rule that "phones must have a USB-C connector" The Law? No, it's just lawyers with too much time on their hands.
The EU is composed of multiple bodies, one of which is unelected people, one of which is people chosen by someone who is elected (roughly) and one of which is people directly elected by EU citizens.
This last body is a Parliament, and is where laws happen.
Once laws are voted, each individual country has a delay to transform it into a local law.
So, yes, the fact that phones must have a usb-c connector is, in fact, the law. The text is here: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:32...
Admittedly, it's a bit more complicated than that between who has to say OK and whatnot because, you know, that is how The Law works.