There are three basic factors...
- Bid Amount - the cost per click an advertiser is paying for that ad
- Relevancy - the keywords defined by the advertiser matching the keywords that Google associates with your webpage.
- Quality Score - explained below...
In short Quality Score identifies the likelihood this ad will get clicked and result in a sale or action for the advertiser. Quality Score is determined by a variety of things, with the click through rate (CTR) being the most significant.
Hence, AdSense first figures out which ads match your webpage based on relevancy, then it looks at which ads will yield the greatest earnings. Earnings is the combination of Bid Amount and Quality Score.
So what can you as a publisher do to encourage more ads with highest earnings potential?
Crawlability: The single-most effective thing you can do is to make sure your pages are crawlable by Google. If Google has your page indexed, it can then determine relevant ads. If it's not indexed, it's only going to display public service ads (PSA).
Submit a site map into Google Webmaster Tools. Use a site map generator (I use A1 Sitemap Generator for non-blogs). For Blogger blogs, here's an article that explains how to submit sitemaps.
Also, make sure every page of your website is linked together. Better yet, make sure every page is linked up from at least two other pages. On a blog, have your articles link directly to other articles within the body of the articles. Try using "Related Posts" links.
Promote Poorly Trafficked Pages: If you visit a page on your website, and notice the AdSense ads are irrelevant, it could very well be due to a lack of historical CTR data. That may mean this particular page of yours is rarely ever visited, and hence AdWords can't determine a Quality Score.
Find a way to give that page more traffic. Link it from the homepage. Create a "Featured Archive of the Week" section on your blog. Take a look at the TITLE and META tags to make sure they are optimized.
Use Consistent Subdomains: AdSense sees "www.mydomain.com" different than "mydomain.com". Hence, if you have a page that is linked from another page with the "www", and then linked again from yet another page without the "www", you're actually making it more difficult for Google to collect data to calculate Quality Score.
Refine Your On-Page SEO: Google still has difficulty understanding the true interest of your audience, and as a result may display ads that seem relevant, but are actually not.
For example, you may have a blog on that publishes artful photos of floral arrangements, and your audience are primarily hobbyists seeking to appreciate the art of beautiful floral arrangements.
However, AdSense is displaying ads for "Send Mom Roses for Valentine's Day". It's related to flowers, but totally not what your audience will click on.
You have to figure out what ads your audience is attracted to, and then figure out what keywords best associate with those ads ("flower photography", "floral supplies"), and then plaster those into your content and TITLE/META tags.