Both are equally important factors for keyword ranking and driving traffic. Proper on-site will give complete information and Google friendly. Off-site optimization helps to driving huge traffic and keyword ranking too.
You can improve keyword ranking by Off page and On page SEO techniques.In off page techniques are blog posting,article submission,guest posting and on page techniques are meta tags,meta descriptions,title tags,relevant content,urls robot,txt etc.