SEO and SEM both play a vital role in digital marketing but there is a broad misconception of people is SEO and SEM are the same in working.
So yes, both work for generating traffic on the website and providing the ranking to websites but the way of working is very different. SEO provides organic results and SEM provides paid results. Both have their importance in digital marketing.
source