If you want to be able to share your Mac's tracks with all your other devices and download songs from the Apple Music catalog, you need to enable iCloud Music Library.
iCloud Music Library is Apple's cloud-based repository for all your music (and music you've saved or downloaded from Apple Music). But before you enable it, there are a few things to know.
Cloud-based matching can be buggy
Apple has been working on the iCloud Music Library concept for just over four years—the company started with a version of it called iTunes in the Cloud back when iTunes Match first launched in 2011. A lot of the bugs have been straightened out, but you may still see errors here and there if your music library is particularly complex.
What kind of errors? Stuff like:
missing or mismatched album artwork
live tracks matched to their studio versions
The vast majority of people's libraries shouldn't see these errors, but regardless: Before spinning up iCloud Music Library, you should make a backup of your music library. This way, in case anything goes pear-shaped, you have a place to reset.
If you want to turn iCloud Music Library on or off, here's how you go about doing that.
On your iPhone, iPad, or iPod Touch
In the Settings app, tap Music.
Scroll down to the iCloud Music Library setting.
From here, you can either enable it (which then asks you to Merge or Replace the music currently on your iPhone), or disable it (which then warns you that any Apple Music tracks you've downloaded will disappear).
On your Mac
Go to the iTunes > Preferences menu.
Under the General tab, check or uncheck the iCloud Music Library option.