Both are vital, but there are actually 4-5 divisions of SEO, or 'locks'--- links, onpage/UX, content, keywords (researched with good search intent analysis), and social signals. Bunching technical issues like tags, user experience, site structure, and content overloads the onpage considerations. Even backlinking can cover 3 different areas (linking for direct impact on SE ranking, links to build direct traffic apart from SE, and links to build trust/topical relevancy). Offpage is more discussed because of the time factor, i.e. most people prefer to see traffic and ranking improvement sooner rather than later. Improvement happens with good content and onpage eventually, but you might want results in the short and mid term.
The most important factor with onpage for optimizing a site is the UX element. Google’s ongoing changes to its algorithm (including innovations like Rankbrain) factors in how visitors receive the site they go to. If they bounce out of it, or use the back button as they found the page to be of low value, Google will lower the ranking regardless of what hyper power authority backlinks were created to originally rank it. Good linking, or even linkbait has to lead to value bait, or reasons stay on the page, to optimize rankings and keep them optimized.