Forum Moderators: open
Folks on the Adsense forum have noted that it is sometimes very difficult to get relevant ads on their pages and they sometimes get ads which relate to a single occurance of a term on the page and no backlinks with that term even though the page is well on theme for the relevant ads that they are not getting. The technology is not perfect and may still have a number of bugs.
I can confirm Hissingid's observation. Things have gotten better, though, and this may bode well for the increased use of "theming" in Google search as time goes by.
Here are some thoughts based on my personal experience with AdSense:
Not too long ago, I had an article on Munich's Oktoberfest that was displaying ads for beer tappers, kegs, and coolers because--deep down in the body text--there was a line about how the mayor of Munich taps the first keg of beer at Oktoberfest. That's no longer happening.
On the other hand, an article on using ATMs abroad still has ads for ATM equipment and supplies, probably because the article is full of references to ATMs.
In other words, AdSense still hasn't figured out context, but it's no longer so easily confused by isolated appearances of a word or phrase.
AdSense is also getting better at selecting default or backup ads that are based on my site's theme when it can't find targeted ads for a specific page. In the past, it would just grab one of the topics in my column of affiliate links and use that to determine what my site was about. The ads weren't irrelevant, but they tended to be narrow in focus. Now I'm seeing a broader range of themed ads (i.e., ads for "air fares to Elbonia" and "Elbonia tours," not just four ads for different vendors of Elbonian oxcart passes).
Googlebot and the AdSense "mediapartnerbot" may not be working together per se, but it's reasonable to assume that lessons learned from either one can (and will) be applied to the other by Google's technology teams.