Search engines crawl and index the web and earn almost entirely from ads placed beside results, with one company dominant in most countries.