Note also that most copies of music are for personal use only. If you're having a party, you can play it, but if the party isn't yours then you can't.
What to do if you want to use music in school, in a coffeeshop, in a public event and so on I do not know. I would like to learn, if someone here does know!
The business pays a licensing fee to SESAC, ASCAP and/or BMI to be legit. And, in my experience, they are quite aggressive about making sure their licensing fees are paid.
Fees are based on various factors and uses, including square footage, cover charges, live or reproduced music, type of establishment, in some instances minutia like how many speakers, etc.
Failure to have the licensing can subject a business to $750 - $30,000 in damages PER SONG played (with up to an additional $150k in penalties if the business “willfully or intentionally” played unlicensed content) depending on a lot of factors.
ASCAP and BMI in particular will send “spotters” into retail and restaurants/bars that have not paid for licensing to listen for songs from their catalogs. If they hear songs from their catalog (and the only way they won’t is if you’re only playing unsigned artists), they will send demand letters, noting the specific songs played.
This is usually more a way to force the issue of paying the fees, instead of seeking damages. But, if those letters are ignored, they get aggressive fast, and an unlicensed business will be sued. And, because ASCAP/BMI have informed the business that playing their music without paying the fees is illegal, the escalator for “knowingly and willfully” doing Schiit kicks in.
On the plus side, often, if a a business is using a “pro” streaming platform of some kind (Musak, Pandora for Business, etc), those licensing fees can be baked into the subscription plans. But the baked in fees usually only apply to music played on/through the subscription platform/hardware (read your TOS!).
So, technically, if you own a cafe that most of the time streamed background music from a Pandora box, but on Sunday hooked up a turntable to your system for a “vinyl listening night,” you probably are liable for more fees than what the Pandora license covers. And ASCAP/BMI/SESAC do look for these sorts of promotions which is a whole lot easier today, when a well built piece of software can do most of the detecting for them.