Google Adsense works on following mechanism, where i would say Google (company) has two tools,
1. Google Adwords – For Advertisers
2. Google Adsense – For Publishers
Now suppose, an advertiser like “Apple Inc” wants to advertise its products lets say ‘iPad’ and ‘iPhone’, now what happens is, Apple inc (advertiser) pays the advertising amount to Google company (ad-agency), now google with help of its own Publisher Network called “Google Adsense” pays the publishers (website owners) a Percentage of what it has got from advertiser. So in short, if Apple pays USD 100 to google inc, than google will keep USD 39 for itself, and pay rest $61 to the publishers through (Google Adsense platfrom).
So this is how it works.
Google earns more than $20 billion each year with help of just these 2 tools. $$$