Whether this was legal is... a gray area, it was a somewhat legitimate company that won some kind of Canadian startup contest on TV, but the music industry was, very predictably, furious at their business model.
Eventually, Apple got scared enough of being sued along with them that they caved in and removed the app, but that took far longer than I thought it would.
There's a good article at https://torrentfreak.com/apple-removes-parasitic-streaming-a...
[1] https://apps.apple.com/us/app/musi-simple-music-streaming/id...