When you’re viewing a message in Mail on an iPhone or iPad, you get five buttons: Flag, Move, Archive or Delete, Reply/Forward/Print, and New Message. But what determines whether that third button is Archive or Delete? iOS hides that option in Settings > Passwords & Accounts > YourEmailAccount—the details then vary by account type before you see the Move Discarded Messages Into options.
iCloud as your primary address: Mail (under Advanced) > Advanced
iCloud as a secondary address: Account > Mail > Advanced
Gmail or other email provider: Account > Advanced
But what if you want to archive a message when you have Deleted Mailbox selected, or vice versa? Simply tap and hold on the Archive or Delete icon, and a popover appears, giving you both choices.