Search Engine Optimization (SEO)
SEO is the process of optimizing your website for the purpose of getting free traffic from search engines.
SEO is important because an optimized web site is easily understood by search engine crawlers and this increases the chances of ranking higher in SERPS (search engine results pages).
Search Engine Marketing (SEM)
SEM is a digital marketing process with the goal of increasing visibility in search engines either by getting organic traffic through SEO or paid traffic through PPC advertising.
Through paid search advertising you essentially buy advertising space in the search engine results. So, instead of trying to rank in one of the top positions organically through SEO and get free traffic, you pay to appear in front of the search results.
The most well-known advertising agency for PSA is Google Ads (formally Google Adwords). Through Google Ads, you can get your ads to appear in the Google search results and you pay only for the clicks on your ads.
This is also the reason why the whole process is called Pay-per-click or PPC. Bing and Yahoo have a similar system but it not so successful and widely known as Google Ads.