One of the main reasons this program is so successful is because the ads that are displayed closely match the content of your website. This increases the chances that someone will click on the ads.
Here's how Google accomplishes the content match...
"...We go beyond simple keyword matching to understand the context and content of web pages. Based on an 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."
So let's say you have an information website about yoga. Once you join AdSense and paste their ad code into your site, Google's technology will determine the topic of the pages by scanning for keyword repeats, page title, etc.
If successful, you will see ads that relate to yoga displayed on your web pages. Of course, the more related the ads are to your site's content, the better the click-thru.
Keep in mind, the ads may not be an exact match because it depends on the ads inside Google's database. So instead of seeing yoga ads, you may see more generic ads like exercise, healthy eating, etc. This is not a bad thing because these are topics your visitors will likely be interested in as well.