Each and every search engine has their rules and algorithms, according to which they rank your sites in search engine when searched for particular keywords.
Well this is difficult to judge 100% accurate. But according to me it determine the quality and relevance of a Web page. Also a guesswork out of increasing your site's visibility by keyword suggestions, content analysis, site map tools, submission to search engines and reports for tracking progress.
The simple answer is that the search engines attempt to list the results starting with the most authoritative, relevant websites for the search query. However, this is an extraordinarily complex algorithm, taking into account hundreds of variables on millions of webpages and returning the results in fractions of a second. The algorithms take into consideration the content on the page, the depth of content on the domain, the meta-tags and titles, the age of the site, the number and nature of in-bound links, the frequency of updates to the site, and dozens of other factors. As a result, Search Engine Optimization is a complex undertaking, one that requires a diverse set of skills and a deep understanding of the main factors involved in the ranking process.