Your iCloud account and Apple ID are storing them.
Sync Library needs to be enabled. (iOS 13 uses “Sync Library”, iOS versions prior to this use “iCloud Music Library”)
You can get all your Apple Music and playlists back using your phone by following the below steps:
Sign out of the iTunes Store and then sign back in. Use the same Apple ID.
In settings - Music - Turn off Sync Library and then turn it back on.and Turn on “Show Apple Music”
Downloads are stored locally on the device used. You will need to download again. OR while in the settings above, scroll down a bit and turn on Automatic Downloads. This setting will at least help for when you add music to your library to be downloaded, going forward.
More info:
https://support.apple.com/en-ca/HT204926