Search Engine Optimization (SEO) is the technique, which helps search engines find and rank your site higher than the millions of other sites in response to a search query.
Search engines are not humans, search engines are text-driven. Search engine do different type of work for giving better ranking of website, like crawling, indexing, processing, calculating relevancy, and retrieving.
First, search engines crawl the Web to see what is there. This task is performed by a piece of software, called a crawler or a spider (or Google-bot, as is the case with Google). Spiders follow links from one page to another and index everything they find on their way. In the web there is billions of pages or website , it is impossible for a spider to visit a site daily. Sometime spider visiting your site for a month or two.
After a page is crawled, the next step is to index its content. The indexed page is stored in a giant database, from where it can later be retrieved. The process of indexing is identifying the words and expressions that best describe the page and assigning the page to particular keywords.
When a search request comes, the search engine processes it – i.e. it compares the search string in the search request with the indexed pages in the database. Since it is likely that more than one page (practically it is millions of pages) contains the search string, the search engine starts calculating the relevancy of each of the pages in its index with the search string. There are various algorithms to calculate relevancy. Each of these algorithms has different relative weights for common factors like keyword density, links, or meta-tags. That is why different search engines give different search results pages for the same search string.
The last step in search engine’s activity is retrieving the results. Basically, it is nothing more than simply displaying them in the browser – i.e. the endless pages of search results that are sorted from the most relevant to the least relevant sites.