We go beyond simple keyword matching to understand the context and content of web pages. Based on a sophisticated algorithm that includes such factors as keyword analysis, word frequency, font size, and the overall link structure of the web, we know what a page is about, and can precisely match Google ads to each page
PF, yes you missed something :)
the engineering team at Google will be pulling their hair out if they see this.
You can think of it this way. Google places ads on your website almost the same way it ranks in the search engines (kinda). Meaning, If your websites is about blue widgets then it is going to display ads about blue widgets. How does it do this? By sending out a spider called "Mediapartner Goolge", that analizes your each webpage to know what it is about. So if you are testing the code from your office computer and not on the actual domain, then you are not going to see the same ads as if it was on your domain.