It is a method used for maximising the number of visitors of a website by ensuring the higher position of the site by optimising the search.
It is an online marketing technique which involves promotion of the website by increasing visibility of the site in SERPs with the help of optimisation and advertising.
Relationship
SEO is a part of SEM.
SEM is a broad term used for traffic generation and is a superset of SEO.