Well, there are some general steps that Google takes in order to produce search results. First of all Google does something called Crawling, then Indexing and finally it does something called Ranking and serving the most relevant pages to the users. Crawling might seem simple, however it is one of the most difficult processes. First of all, Google will look for the pages that have better rankings and that have trustworthy sites linked to it. That way Google is able to know that pages that rank best are really the best pages. After that Google will index the most relevant pages and finally release them as the most trustworthy pages.
Years ago this whole process could take as much as 40 days to happen, from step one to step 3, however now Google is able to do very good crawling every single day. Now indexing is all about comparing documents that have the words you are looking for and giving the user web pages that are most likely to be the ones the user is truly looking for. Before Google actually delivers the user the page that has what he or she is looking for, Google will rank it based on several different parameters. Google will give preference to web pages that already have a much better reputation online and that is most likely to give the best content to the user.
This whole process of crawling indexing and delivering the user the most relevant information happen millions of times every single day all over the world. This happens whenever a person types anything on Google. In seconds the person will receive the most relevant results. Even though it might seem like an easy and simple process it is certainly not. Day by day Google is improving this useful tool to deliver users the best information possible.
Video: How does Google search work?
(YouTube Release: April, 2012)