Before Family Sharing came to be, sharing one Apple ID between family for apps, music, movies, and other purchases allowed each family member to have a separate Apple ID for iCloud services so that not everything had to be connected. On the other side of the coin, some people have different Apple IDs for iTunes purchases and iCloud services. This could be because they have a personal Apple ID and one for work, school, or another scenario where you want a little separation. Many users have one Apple ID that they use for everything, but others may actually have multiple Apple IDs.
However, things get slightly more complicated when you want to listen to Apple Music on another device you use with a different Apple ID, such as a work iPhone.
Your Apple Music subscription is tied to the Apple ID that subscribed, so you can stream content from any iOS, iPadOS, macOS, tvOS, or watchOS device that your Apple ID is signed in to.