Just wondering how google works out what site will get to the top in its results, is it based on how many hits the site gets?

also if your running a personal web server can you register this in search engines, do you need to register a dns or something?

cheers.