SEO is basically divided in two major parts on page SEO and off page SEO. Both are crucial to the success of an SEO campaign, but they're on completely different sides of the fence when it comes to improving your search engine rankings.
On-page SEO ensures that your site can be read by both potential customers and search engine robots. With good on-page SEO, search engines can easily index your web pages, understand what your site is about, and easily navigate the structure and content of your website, thus ranking your site accordingly.
Off-page SEO focuses on increasing the authority of your domain through the act of getting links from other websites
Both are important. Onpage do when you optimize your website which is contain Meta Tag, Meta Title, Meta Description etc.
Off page doing on daily basis of such activities Bookmarking,
classified submission, Image Sharing, Quora, Ask, Reddit, Article Post, Blog Post, Guest Post, Blog commenting and many more activities.