The library on the PC is used as the master library. When syncing, anything not in the library or not selected for syncing will be removed from the device being synced.
Your iTunes library on the PC needs to contain everything on the iPhone, otherwise the content on the iPhone that does not exist in the library on the PC, get’s removed from the iPhone.
Apple Music is an app. It can hold a music library just like iTunes can. On a PC, Apple Music can replace iTunes as your music manager. There is no operational difference between an Apple Music library and an iTunes library. They work the same way.
If you choose to use the Music App to manage your library, then you need the Devices App to sync music to your iPhone, but the function remains the same, you still need your full library in the Apple music app on the PC. Otherwise anything not in the library on the PC gets removed from the iPhone.
The Apple Music app additionally lacks the ability to actually Rip CDs so it’s not really useful here.