Stop Apple Mail from archiving all your emails
I found the solution to the problem of Apple archiving all the emails. Go to Mail and click "mail" then "settings", then click on "Accounts. It will show your accounts. On the account you are having trouble with eg gmail, click on "mailbox behaviors". Scroll to the bottom where it says "Archive". Make sure what is clicked is only "gmail" and not "gmail/all mail"
iPhone 11 Pro, iOS 16