SEO is done on-site and is a process of organizing your information architecture so it is search-engine-friendly, and then creating content that is relevant to your target market. That way you can get indexed for the terms you want, so that you appear on SERPs (Search Engine Results Page) exposing you to your target market at their time of need.
Once that's done, SEM begins which is about attracting off site links that get you ranked high on those SERPs so you get traffic. (There's another side of SEM that's about PPC.)
SEO and SEM go hand-in-hand, but they are still two different things. (Not being snarky, just pointing something out. I'm an online marketer and client education is the biggest challenge of my field.)