They don't: "We will not scan or read your Gmail messages to show you ads"
https://support.google.com/mail/answer/6603?hl=en#:~:text=Th....
Do you have evidence that they do? I think Google said they did this a long time ago, but they stopped since email content didn't actually improve revenue on those ads. Message data just isn't very helpful for ads, they would do it if it was useful but it isn't so they don't.