Keyword Search Identifies Relevant Terms to Target

Keyword search and research is required to identify attractive target keywords for your pages. When you search on Google, millions of results appear from the database in less than a second. The results are sorted, starting with the best match at the top. How does Google decide?