Assume that. your reading a book and want to find references to a specific word in the book. What do you do?
You turn the pages to the end and look in the index! you will then locate the word in the index, find the page numbers mentioned there and flip to the corresponding pages.
Search engines also work in a similar way.
Search engines are constantly building and updating their index to the www. they do this by using "spiders" that "crawl" the web and fetch web pages. Then the index along with where the words came from.
When someone searches for "pest control services" the search engine already has a list of web pages that refer to "pest control services". The only thing left to do is to sort the web pages in order of relevance. This is done based on a number of key factors.
Crawl then Index:
When a search engine spider visit a website it reads all the content and follows all the links internally, and then it decides what to index the webpage for. This is why it is SO crucial to have search engine optimised content on your website. If there is no search engine visible content on your website (mostly meaning content in HTML), the search engines won’t know what to index your website for and you might be indexed for keywords that are not related to your business.