Search engines have two primary goals. First, a goal of all search engines is to present their search users with the most relevant and up-to-date answers to a search users search query. The second goal is to protect their search indexes from spam. With both these goals in mind, search engines have developed literally hundreds of parameters for determining what a website is really about and how to determine if the site is trustworthy, not spam. Remember it is all about serving search users the best possible answers to their queries.
In essence, search engine optimization has two basic facets; telling the search engines what you are targeting and telling them why you should be trusted. Although this statement is an oversimplification, we will stick with it for the sake of brevity.