Search engines use complex algorithms to determine the order of search results. These algorithms consider factors like keyword relevance, page quality, user behavior, and more to rank pages by their perceived relevance to a given query.