There are two types/ methods of ranking your website on-page Search Engine Optimization and off-page Search Engine Optimization, but most people focus on off-page Search Engine Optimization, yet the key point is partly decided by on-page factors. On-page SEO factors are all those tricks and techniques done from the main website that can influence your actual website. These factors include; the quality of your code, site speed, and content-related aspects, like the structure of your website or the copy on your website.
In addition to on-page SEO factors, some factors include links from other websites, social media attention, and other marketing activities outside your website. They can be rather difficult to influence. As it counts from the number and quality of links pointing towards your site. The more quality, relevant sites that link to your website, the higher your position in Google, Yahoo, Bing, and Yandex.