How do search engines rank relevancy?

 location of search term
§Title words are assumed to be most relevant
§
§Keywords appearing near the top of a web page are assumed to be relevant
§
§Assumes that any page relevant to the search term will mention those words right from the beginning