Search engine optimization (SEO) is the process of getting your website to show up in search engine results pages or SERPs. The basic step by step is:
When you use a search engine (like Google) they scan their database of websites and choose which is the best websites to show for that keyword.
The top ten websites listed on the first page are chosen based on relevancy, authority and usefulness.
Simply put, those websites are related to the keywords niche and can answer the users questions quickly and well.