Seriously, before this law was put in place, Europe had been asking companies to agree on a common charging port for more than a decade.
The first Memorandum of Understanding on the subject was signed in 2009. Amusingly Apple did sign it before deciding to simply ignore it. That was followed by a directive in 2014 and an impact assessment in 2018.
Despite these repeated warnings, Apple spent the decade lobbying against a common port while collecting a tidy sum with the Made For Iphone initiative.
The EU didn’t mandate by hubris. It just had to. We need a law because if we don’t have one there will always be companies reverting to proprietary ports. They just can’t resist the easy money.