Yes, it obviously does. Gmail is an ad-supported emailing service. Gmail scans and analyzes the email contents of every user. They have automated software for this purpose. The scanning and analyzing is done basically to check the viruses and malwares to provide a great user experience but as it is ad supported, tailored ads pop up according to the email contents of a user
The simple logic is to rev up the advertisement revenue as it doesn’t charge a single buck from its users until they have opted for paid Google accounts. However, this transparency is limited to the service provider only. No advertiser has any right to access a Gmail user’s account without the permission of the account holder. A user can stop seeing the personalized ads by changing the ad settings in Gmail.
Useful websites for further reading: