SEM ads are shown based on the results of automated auctions that happen in real-time. The position the ads show up in is based on an advertiser's bids, the quality of the ads, and the likelihood of a user clicking on the ad.