Google's search engine works by crawling web pages to index their contents into a giant database. When a user searches for a query, Google processes the request by searching its indexes and calculating the relevancy of pages to the query. Google then shows the most relevant results to the user's search.