Apple Media Services Terms and Conditions
https://www.apple.com/legal/internet-services/itunes/us/terms.html
"When your Apple Music membership ends, you will lose access to any feature of Apple Music that requires a membership, including but not limited to access to Apple Music songs stored on your device, and iCloud Music Library. Apple reserves the right to cancel your Apple Music membership if we are unable to successfully charge your payment method to renew your membership."
I have seen several posts where people have been late paying and cannot see their old colletion upon re-subscribing so I guess upon termination all information is immediately deleted.