After crawling and indexing search engine's spider store every bit of information about web pages. When the user inserts any query into the search bar, the search engine shows most relevant web pages in descending order of their relevancy, it is called search engine ranking. It takes the only a fraction of second to complete the whole process.
But how search engine decided which web page get the first position and which will get second and so on? Let’s talk about how Google decides website ranking.
Google does it by asking questions like searched is keywords are present in the website page title and description? Is searched keyword is present in heading tags (h1 to h6), website content, anchor text, URL of the page? and is website getting back-links from high authority websites?
Google actually have 200+ ranking factors and it compares each webs-page for given keyword. The web pages which can provide answers of above questions in better ways get ranking in search engine ranking position.