Hello,
To answer your first question: On https://support.microsoft.com/en-us/office/cancel-a-microsoft-365-subscription-46e2634c-c64b-4c65-94b9-2cc9c960e91b, it is said that:
"**Important:**If, for example, you cancel a Microsoft 365 Basic, Personal, or Family subscription, your storage allowance will revert to 5GB of cloud storage, which includes your OneDrive and Outlook.com attachments, and 15GB of Outlook.com storage. If you cancel Microsoft 365 Family, all the people you shared your subscription with will also have their storage allowances reduced.
If you, or people you shared a subscription with have used more than the free allowance:
- you won’t be able to upload, edit, or sync new files (such as Camera Roll) to your OneDrive,
- you won't be able to send or receive email in Outlook.com.
- after 6 months, we may delete your OneDrive and all files within it.
- Read the "What happens if you exceed your quota?" section in How Microsoft storage works for more information."
This means that after the grace period, your files will be permanently deleted.
For your second question: No, the system does not separate paid and unpaid storage. Once you purchase the plan, your entire OneDrive storage is now considered paid. There isn't really an algorithm that I know of that chooses which files to my knowledge, but once you cancel the subscription and your billing cycle ends, your account will be considered free again, giving you only 5 gigabytes of space for your files, and you will get a notification after a while telling you that you're over your quota and that some of your files will be deleted soon.
A good way to prevent that is to download the files to your computer and then manually delete the files on OneDrive that you have in your computer.
Hope this clears things up.