I ran across this WSJ article from 2018:
https://www.wsj.com/articles/techs-dirty-secret-the-app-developers-sifting-through-your-gmail-1530544442According to the article, "Google said a year ago it would stop its computers from scanning the inboxes of Gmail users for information to personalize advertisements, saying it wanted users to “remain confident that Google will keep privacy and security paramount.”"
It goes on to say that google does allow vendors to scan @gmail inboxes, which is apparently, "a common practice." With no WSJ membership I was unable to read the entire article.
These scans are for marketing and advertising purposes, but it's possible to scan for any keywords, and probably images, etc. Online privacy is long gone, unless one makes a dedicated effort, in which case the authorities have to try a bit harder, if one is doing anything the authorities might be interested in of course.