At the beginning of the web era, users would go to directories to find sites relevant to their interests. In fact, Yahoo!, the web's number one destination, started as a directory. Nowadays, most users rely on search engines, not directories, to find what they're looking for.
When search engines started to become popular, they relied on web pages' 'keyword metatags' to determine the topic and relevance of the page (the keyword metatag is a section within a web page's HTML code where webmasters can insert words that are relevant to the page's content). Webmasters discovered that by stuffing their meta tags with popular search terms repeated hundreds of times, they could propel their pages to the top of the search results.
Search engines caught up to the abuse and decided to ignore the meta tags and rely instead on web page copy. Webmasters then started to overstuff their page copy with popular search terms, often writing them in the same color as the web page's background, so that they could be detected by search engines while being invisible to users.
Again, search engines discovered the trick and decided that the best way to rank a web page's content and its topical relevance was to rely on inbound links from other pages. The rationale behind this is that it is much more difficult to influence other people to link to you than it is to manipulate your own web page elements. In fact, inbound links are the foundation of Google's Pagerank™ algorithm.