The aim is to make the page both useful to users and easy for search engines to understand: clearly stated topic, complete answer, logical heading hierarchy, described media.
It is the counterpart of off-page SEO, which works on the site’s reputation outside the site itself.