Search engines work by crawling the web for content, indexing that content, and then ranking it based on relevance to user queries. Users input their queries, and search engines retrieve and display the most relevant results from their indexed database.