Every time you search, there are thousands, sometimes millions, of webpages with helpful information. In Fact 1 in 7 searches is search that has never been searched before. How Google figures out which results to show starts long before you even type, and is guided by a commitment to you to provide the best information. Even before you search, Google organizes information about webpages in their Search index. The index is like a library, except it contains more info than in all the world’s libraries put together. And all of that is done in less than a fraction of a second.
Before you press enter Google's web crawlers gather information from across hundreds of billions of webpages and organizes it in the Search Box.
Crawlers
The crawling process begins with past crawlers and sitemaps provided by website owners. Computer programs determine which sites to check, when to check them and what to check them for. The files that are gathered by the crawlers are called "robot.txt". Google never accepts payments from website owners to make their website rank higher, crawl on their site more or make their website appear on the top. When Google's crawlers find information, they go from link to link and bring data about those webpages back to Google’s servers.
When the crawlers find a website with useful information, their systems render the content on their servers to analyse them. The Google Search Index contains thousands of billions of websites or over 100 Petabyte of data.
Search Algorithms
With the amount of information available on the web, finding what you need would be nearly impossible with the amount of bandwidth modern smartphones have without some help sorting through it. Google ranking systems are designed to do just that: sort through hundreds of billions of webpages in their Search index to find the most relevant, useful results in a fraction of a second, and present them to you in a way that would be easy to navigate through.
These algorithms are made up of whole series of algorithms. Search algorithms look at all kind of factors, for example: where a keyword appears and is it relevant or not. These algorithms also try to keep out spam websites from appearing in your search results.
Ads
Google earns most of revenue by ads. Most of their ads are on their own sites and apps. By showing ads they can keep these services free for us to use. When you search something, Google searches for ads related to that topic. Ad would always have a Ad sign on the top left corner like this:
If you find the ad useful and click on the ad, the advertisers pay Google. If you see an ad and are not interested and don't click on it, the advertiser is charged nothing and Google makes no money.
Google also makes money by helping other sites make money with advertising. They show ads that are useful to you. When Google shows ads on someone else's site, they keep a portion of the money. The majority of the money goes to the publisher.
Improving Google
Google's goal is to always provide you with the most useful and relevant information. Every day there are thousands of people are testing new features on Google. Last year Google did:
383, 605 Search quality tests
62, 937 Side-by-side experiments
17, 523 Live traffic experiment
3, 620 Launches
Here are some videos and websites you should have a look at to get more information on How Google Search Works: