Both are important, but great depth won't do you much good if your starters are not able to put up consistently high scores.
Depth is more important at RB, WR, and QB than the other positions. So, you will frequently see teams built around getting the best players, including depth, at those three positions before looking to fill starting players at the others.
In my 16 team league last year, where we start 1QB, 1 RB, 2 WR, 1 TE and 1 FLEX(RB,WR,TE), plus PK and DEF, I drafted RB, WR, WR, RB, WR, RB so I was going for both quality and depth at 2 skill positions at the expense of high quality at QB and TE.
Depth is important because you need to have a fall back position in case one of your starters gets injured. You also need depth to cover the weeks when your regular starters have a bye and don't play. But you need the best starters you can get.