Apple Music is a monthly subscription service that lets stream and download any song, or album from the Apple Music catalog.
It does not let you download Apps for free.
It also does not in any way, shape or from stop you from actually buying a song, or an album outright if you want to.
Since downloads from the Apple Music subscription service are tied to the subscription being active, the ability to actually buy a song or album to keep even if the subscription is cancelled or expired is obtained by outright buying the song or album.
Think of a Gym membership, or Netflix You don't own the gym equipment or movies you have access to while you are subscribed, But you can still buy gym equipment or movies if you want to while being subscribed.
Same thing with Apple Music. You pay for access to the entire catalog of music, but only while you pay.
If you want to keep something after that you need to buy it.
If you just want to stream or download without buying you can do that. You have both options for how to get content.