In an article over at iMore, it has been explained that Apple Music is being wrongly blamed for automatically deleting local music files from your hard drive. “Apple Music should never automatically delete files off your primary Mac’s hard drive unless you specifically delete them first”, notes the author, explaining that while the service has definite problems and its matching algorithms aren’t great, but this is simply not how it works.
On your primary Mac, Apple Music scans your music library and matches any tracks you own to its streaming library, allowing you to stream those tracks at their highest quality without having to download them on your secondary devices, such as your iPhone, iPod or another Mac. The tracks which aren’t available in Apple’s music library, are uploaded as-is to your iCloud Music Library. Once done, you have two libraries i.e. your locally-stored library on your original Mac, and an iCloud-stored library that you can access from other devices.
On your original Mac, Apple Music will never delete songs without your knowledge. When you press delete on a song in your iTunes Library with Apple Music or iTunes Match enabled, you’ll see a dialog (shown above). If you choose “Remove Download,” it will send the local file from your hard drive to your Trash, but leave the reference in your library — so that you can stream that track directly from iCloud Music Library. It won’t delete the file until you empty your Trash.
This is great if you’re on a laptop and want streaming access to your music library, but you don’t want the hassle of having 40GB of music on your hard drive. But it should only ever be done on a secondary computer or secondary iTunes Library — never for your master library.
It must also be kept in mind that iCloud Music Library only works as long as you have an active Apple Music subscription. So if you delete your original tracks and replace them with iCloud versions, they’ll disappear 30 days after you cancel your subscription.