We just had a fun discussion about the IMAP protocol on another Macintosh discussion list. By far, the most popular type of protocol used currently is IMAP. IMAP became popular with the prevalence of mobile computing and multiple portable devices that can access e-mail. Google's free Gmail uses IMAP, along with plenty of storage space to hold decades worth of mail.
Most users, coming into the discussion, didn't really understand the "features" of IMAP. IMAP allows you to read your mail on all of your devices, because all of your devices are accessing your mail provider's server.
After you have read your mail on your device, and you decide to delete it from your device, it isn't also deleted from your mail provider's server. In fact, there is no provision in most e-mail clients to delete mail that isn't local (i.e. on the server). This is considered a "feature" of IMAP. Your e-mail can't be accidentally deleted. It's always safe and automatically archived. (This is the point where everyone runs to look at the Preferences in Mail.app. I'll save you some time. Whatever you find there with regard to deleting e-mail doesn't apply to your IMAP server. It only applies to "local" mail. That is, mail that resides on your Mac. Or to a POP account.)
Unless you access your mail provider's mail server (usually only possible via a Web interface) and manually delete read mail, it will be there indefinitely. (Some mail providers may have a policy of deleting your mail after a set period of time unless you pay for a premium account. And with some providers you may be able to have your account set up to do so.)
See:
https://support.reclaimhosting.com/...nderstanding-Email-Retrieval-POP-vs-IMAP#imap
This does bring up questions of security. Can you trust your e-mail service provider never to look at your e-mails? (Google's entire business model is to give you free services and then to mine your private data and sell it. Do you think that Gmail would be free if they weren't doing that?) If your e-mail service provider is subpoenaed, will they simply just hand over all of your e-mails without a second thought? If you are running a company, would it be a better (i.e. safer and more secure) idea to run your own private mail server?