Search engine optimization is a method for sustainably influences search engine rankings. Google and other search engines calculate their search results for keywords using highly complex algorithms. The individual ranking factors and their weighting within the ranking calculation are well-guarded intellectual property that belongs to the search engines and is not publicly disclosed.
Additionally, there are many situations where PPC (a component of SEM) makes more sense than SEO. For example, if you are first launching a site and you want immediate visibility, it is a good idea to create a PPC campaign because it takes less time than SEO, but it would be unwise to strictly work with PPC and not even touch search engine optimization.