It's not a question of which is more important.
Without one, the other won't perform to its potential. Both should work in harmony. What if you just did link building and didn't bother doing any on-site optimisation. You may well achieve high rankings after a while, but who would click on your listing if your site has no relevance to their query? Similarly, if a visitor does click your listing, the chances of an eventual conversion are low.
"In 1969 I gave up women and alcohol - it was the worst 20 minutes of my life." - George Best