IMAP is hosted on the server, deleting the account in most control panels "will" wipe the emails.
Some clients depending how they configured can mirror locally so also is a copy on your own device, which you should do if you want to preserve those emails.