Advertisers bid on certain keywords relevant to their target audience. When a user searches for those keywords on Google, the ads are displayed at the top or bottom of the search results page. Advertisers pay based on clicks or impressions.