AdSense detection is not done on the client side. AdSense knows which ads to serve on which page because it leverages the search index cache and content analysis of that page. In the same way, Google serves contextual ads in Gmail by indexing the content of each email as it comes in.
Of course, every other major public email provider in the world stores email in plaintext too, do I don't get how this is a knock against Google specifically.