Search
Logic
When search engines search with a specific keyword they use a
number of different criteria to locate a relevant webpage AND
to rank it in the results returned to the user. The
criteria can include:

How
many times the keyword(s) appear in the title of the webpage
(seen in the top or bottom bar of most browsers)

How
many times the keyword(s) appear in bigger font sizes

How
many times the keyword(s) appear in the first line of a webpage

How
many times the keyword(s) appear in the webpage

How
many times the keyword(s) appear in the website of which the
webapge is a part of.

How
many times the keyword(s) appear the meta tag of the webpage
(part of the coding of the webpage that the webpage author
uses to help engine spiders find and categorize the webpage)

Ranking
Logic
When the engine returns the results to the user it uses one or
more of the above criteria to rank the results by. Often the
different criteria will have different weight, or influence, in
the ranking logic. There is usually some combination of weight
of the criteria and the number of times the criteria is met that
will determine the rank of pages.