Search engine optimization (SEO) is a set of techniques that you can use to make sure your website ranks higher on search engines like Google. Search engines rely on algorithms and complex calculations when deciding which results to show in their SEO searches, and these algorithms and calculations are updated regularly. If you want your website to rank in the top results, you need to make sure your website is set up to be search engine friendly.
Onsite optimization refers to the things you can do to your website's code and content to help search engines understand what your website is about. Onsite optimization includes things like how well structured your website's content is, whether you have instances of duplicate content, how accessible and fast your site loads for users, whether it has unique and relevant titles for every page, whether your site has secure server certificates installed, etc. These are all things that go directly into how search engines view your site.