People then search the index of what was found. A directory such as Yahoo depends on human editors to create its listings. You submit a description of your site to the directory for editors to review. A good site, with good content, will be more likely to get reviewed than a poor site. A search of Yahoo looks for matches only in the editors descriptions.
Some search engines use a hybrid of a crawler and an associated directory.
Being included in a search engine's directory is a combination of luck and quality. Submitting your site for review is no guarantee that it will be included in the directory. Reviewers have the final say in who is included in their directory. They often search the Internet on their own looking for good sites to add to the directory. The spider visits your web page, indexes it, and then follows links to other pages within the site.