If you are an Apple Music subscriber and you stop the subscription, only the not owned songs will disappears from your library (downloaded or not, it makes no difference).
When I say own I mean purchased (in iTunes Store as an album or single song, in other online stores, coming from a CD, etc.), not “rented” through a subscription. In this case you own them and you can download them whenever you want regardless of an active subscription.
I know, even the subscription is a purchase. The difference is that the content of a subscription is not yours forever. It'll last only until you keep the subscription active.
It's like buying a car – say, named A – by cash. It's yours. Forever. Then you add a subscription which lets you drive all the cars the dealer has in its shop (A, B, C, D). Car A is already yours so you don't care. You can find useful to drive B, C and D cars from time to time. When you stop the subscription you have to return the cars you don't own (B, C, D). Car A remains in your garage because is yours. If, during the subscription, you decided to buy car B (again, by cash) then it will stay with you even when the subscription ends.
Downloading in the example of cars would mean having them stored in your garage. You can store any car you want when the subscription is active. When it ends, only A and B can be stored, because you bought them in full price. The dealer knows you purchased them in their entire value so you are eligible to own them.