Emails are sent over smtp, imap is the protocol to manage the received emails.
If you got “bcc self” enabled (for using multiple devices on the same account) the encrypted messages you sent are also saved to your gmail email account. Also when receiving emails they are also stored on your imap account on google as all messages are “just” emails. We work on a feature that auto deletes messages after an configurable interval.
As long as your messages are encrypted, nobody can read them, but as your mailserver needs to know where to send the mail, the metadata regarding that can not be encrypted, otherwise the mailserver would not be able to deliver the mail.
By the way if you use the internet, you always leave a trace.
And if you are concerned about google spying on you - Don’t use google services.