I must admit that this isn’t my original content; however I came across a neat pictorial from SEOBOOK which visualy illustrates how google treats a search query.
Also below the illustration, please find a google seo video by Matt Cutts on How does a Google Search Work….brought to you from the Seo Marketing Company blog page: