It's tough to figure out exactly what content the bot is reading. Sometimes it seems to read the content closest to the leaderboard at the top of the page. Then the next day it will read the content at the bottom of the page. It's screwy.
It scans the full content of your page, figures out your keyword that pops up the most, "reasons" that this is what your page is all about, figures how many high paying ads it has for that keyword, and delivers it. This is why people who have blogs but little content end up with mostly blog ads. They apply early, with a half-finished site with one or two entries, and all the bot can find is the word "blog" everywhere, so of course it concludes that your site is about "blogs" and sends you nothing but blogging ads. This is why you should never apply for Adsense on a blog that's not fully stuffed with entries and, by proxy, keywords.