Each month auction gets run billions of times, and the results are such that users find ads that are relevant to what they are looking for. The search engine processes the request and runs the auction that determines the ad positions and each advertisers CPC.