How search engines rank pages

Once a website has been crawled and indexed, the search engine then has the task of ranking the page for different search terms.

When search engines first came about they were in essence information retrieval systems. When a user entered in a keyword, the search engines would look in their index and try to return the most relevant page for the search term.

Over time the search engines have had to evolve to constantly bring users more accurate and relevant results. To combat manipulation of the search results, more and more complex algorithms have been created to rank pages.
When a user enters a keyword, the search engine looks through the index to find all pages that it deems relevant to the keyword. These are then ranked in order of relevancy.

The relevancy of the page is made up of a number of factors which are all included in the search engines algorithms. Modern day search engines such as Google cover more than 200 factors in their algorithms. The more of these factors your website is optimised for the more likely you are to rank high up in the results.