How does Apple Music know what songs are in my personal library?
With an Apple Music membership, your entire library lives in iCloud. We compare every track in your collection to the Apple Music library to see if we have a copy. If we do, you can automatically listen to it straight from the cloud. If you have music that’s not in our catalog, we upload those songs from iTunes on your Mac or PC. It’s all in iCloud, so it won’t take up any space on your devices.