How does a search engine use algorithms to provide search results?

by creating keywords and phrases
by recording and storing data for worldwide use
by retrieving and ranking relevant search results
by limiting the type of search terms that it will accept