The ban follows form article 13 of the directive on privacy and electronic communications: https://eur-lex.europa.eu/legal-content/en/ALL/?uri=CELEX:32...
The ban is not 100 percent effective - I receive a robocall maybe once every year - but it's pretty efficient. From the numbers I read here, it's some 99.9 percent effective. I have lived in 3 different EU countries and it wasn't a big issue in any of them.
Different countries in the EU have implemented the ban differently. But generally, businesses that use robocalls are fined on a per call basis. So it is an issue that can be dealt with by regulation. Companies breaking the rules are fined and the risk of being reported is high so it's not a viable business model.
I still receive spam emails, which is the same and is also illegal, but - and I don't mean anything else than to state the fact - almost all spam I receive is from outside the EU, such as America, Russia, Africa or Asia.