The main thing to remember is that it looks at TEXT content in the html in your web page file. It can't see stuff in css files, scripts, dynamic content, image files, database files or auxillary files. And it ignores meta tags.
The order the websites are listed is determined by two factors:
1. The completeness of the match to the search parameters
2. The number of times the site has matched previous searches (tie breaker)
Remember that your ISP must allow robots to search its contents for your site to be searchable with search engines.
One other thing: If the name of the site contains non-alphanumeric characters (such as a hyphen or an asterisk), the search engine can not find it.