SEO ... search engine optimization, increases the prominence of a website or web page. Simply said, the more often a particular site shows up in the search results list on the first page, the more visitors it gets from the search engine's users. More specifically, this applies to the natural or organic (unpaid) results of a search engine.
For the term on page vs off page SEO, there really is no "against" each other. Both are important to any website.
SEO can be geared toward various kinds of searches, such as image, local or video, for example, but regardless of the category, websites that use good SEO practices will stand out, as opposed to ones that do not.
To clarify the differences between two of the main elements for SEO, on page and off page optimization, let's look at the basics for both, with the following distinction in mind: