I always saw Tarkin as being the top man in charge on the Death Star and Vader being the Emperors representative sent to watch over the completion of the Death star and to make sure Tarkin didn't stuff it up. Tarkin is clearly in charge of operations on the death star, but ultimately answerable to the Emperor via Vader. Tarkin's leadership and strategy is well respected by both Vader and the Emperor, that's why Tarkin is allowed to stand up to and give orders to Vader but he knows well enough not to overstep the mark .There's a very obvious sense of respect between Vader and Tarkin.