I’m not sure it does, or if it does it doesn’t work very well. I have an apple music subscription. If I enable iCloud Music Library it only adds the songs to my other devices if they’re available on Apple Music.
There doesn’t seem to be a way for me to upload my own MP3s to the service like you can on Google Play Music.
Family sub for $14 month and $25 year for match to keep all my music even dodgy mp3s safe from bitrot is well worth it.
I move dozens of times a year, I no longer have to haul books and cds, I for one welcome my digital overlord.