Oh wow, I just learned that in many cases this is not true. I ripped a CD and added it to the Music app library, which synced it to the cloud. I then clicked Remove Download in the Music app, which deleted the local files I had ripped. I then played the album in the Music app. The album started playing in Dolby Atmos format as there is an Atmos format of this album in the Apple Music streaming service. So Apple Music did look for a copy of the album in its streaming service library and played that instead.
What confused me earlier was that uploading CD quality audio files on your machine does work if the album cannot be matched to one Apple Music has in its archive. It appears you can look at whether a supposedly uploaded file is truly uploaded in CD quality or just matched to an Apple Music file by right clicking on the file, selecting Get Info, and then clicking on the Files tab on the upper right.
There is a way to force Apple Music to upload your files. Apple Music does not attempt to match any file with a sample rate above 48 kHz. So here is the process - a little time consuming, but it will allow you to have lossless files of your own music alongside the streaming files on your Mac.
1. Convert your file (if it’s 44.1 or 48 kHz) to a sample rate of 88.2 kHz. Bit depth does not matter. I use dBpoweramp for the conversion.
2. Add the converted files to Apple Music and update library. It is also a good idea to use a different tag for the album, as this will ensure artwork is kept intact. The files will not be matched.
3. Once the files are uploaded, go into the folder containing the uploaded 88.2 kHz files; delete these and replace them with the correct sampling rate files. Also delete these files from trash, or the Music app will still look for them there. Make sure the correct files are named EXACTLY the same as what you uploaded. Obviously, if your file originally has an actual sampling rate of 88.2 kHz or higher and you want to keep it at that resolution, you can ignore step 3.
4. To test your files, go back into the Music app, using the Songs view with “Sampling Rate” displayed in the column heading. As you click on each song, you will see the sample rate change to the correct rate.
This has worked 100% of the time for me, with the app never attempting to change my file or match my music at a later date. I do still keep my files intact outside of Apple Music as a backup, just in case.
Hope this works for you!