You might have noticed that I always use Google as a search engine example. This is because Google has the most market share in all three (3) areas: desktop, mobile, and tablet.

There was a time when the Internet was not yet around or fully evolved; people, particularly students, hugely relied on public or university libraries. To find the book you need, you have to go through the catalog of books using index cards sorted out by the librarians.
The search engines are of the same nature. The obvious difference is that they are much faster to crawl (find) and index your sites, and it will be quicker for people to access them. At present, it is just at your fingertips.
Simply put, search engines are your digital libraries, and they are more than that. If the index card in the libraries can store the names of the books, search engines can store and index every “book” and every page in that “book”. These are the domains and every URL on that domain (so not just the websites, but every webpage of those websites).
Search engines can do this using their algorithms. Thus in the world of SEO, you can sometimes hear the word: Google algorithm.
Though generally, no SEO specialist can ever claim that he knows how this algorithm works, at least they have several clues as they progress and update themselves in years.