Advertisers bid on keywords relevant to their business, and when a user searches for those keywords, the ads are eligible to appear. Advertisers are only charged when a user interacts with their ad by clicking on it.