This is a fair enough question. You search something online, via a search engine, an you find millions of results. For example, you Google something as random as “family doctor” or “divorce lawyer”, and you get about 16,000,000 results. You type in the key words you’re looking for, and then Google gives you the results: 1 - 10 of about 16,000,000 results about “family doctor”.Now 16 millions is a lot, and still, Google doesn’t just give you the results randomly, but it ranks each and every page so they come in a precise order, one in front of the other. How do search engines rank pages?
There isn’t an exact answer that will tell you exactly what to do to be ranked first by a search engine, but there is a general concept. Let’s take Google again. When Google searches for your search term, it starts the search with those pages containing the exact same term or phrase. Those will be the first pages in the results. After looking for exact matches, it starts looking for pages containing the words close together, then for pages that contain your search terms, but they’re scattered around.
This is the general concept. However, you will find that this is not always respected. For example, sometimes it may give you pages with the words close together, and then pages with the exact matches. This happens because search engines have various criteria based on which they evaluate pages. They don’t just look at the words you typed in, but at many more factors. Yes, they look for the words throughout the page, and not only in the visible page, but also in the HTML source code for the page.
This way, each time they find a word that matches your search the word is ranked, so that a word in one position or context is more valuable than another word in another position, according to how the words are “formatted”. And these are not the only criteria. You know those various links you find pointing to pages?
Search engines also look at those links, and uses them to evaluate the referenced pages. Again, there are various criteria for these pages and their links, such as the number of links, the number of links from popular sites, the words in the link text... and so on. So basically, search engines rank pages by so many factors and in so many ways, that the answer is more or less beyond our grasp. But we may poke around the general concept at least.
Mihai is the author of this article. If you are interested to read more, feel free to check his other articles for useful information.