The search engines regularly trawl though what are called meta-tags in the html of known web pages and build up an index of these meta-tags on their own databases. When you search, you search this database rather than the web driectly - that's why sometimes the links you get in the search results are out of date.
Owners of websites must also submit their site to search engines in order for them to be searched, indexed and stored on search engine databases before the contents of those sites will be displayed in search results.