Google Adsense works on word frequency with keywords. That's why you see ads for sites selling real estate in Portland, Oregon on another blog that's been flogged to death on Free Republic, that appears dedicated to actually badmouthing and talking down residential real estate. In this particular instance, the word "Mormon" is no doubt used a great deal, so you get ads directed at Mormons, for underwear or whatever.
Right, AdSense looks at the keywords on the site. But the other part of the equation is the advertisers who choose which keywords to push their ads on. So, if I wanted to associate "Mitt Romney" and "Mormon" in people's minds, I would bid my ads for "Mormon Ringtones" on the keywords "Mitt" and "Romney" and "Mitt Romney", thus ensuring appearance on those sites that mention him a lot.