There are many reasons, not just in test but other formats aswell. You people might find this funny or kiddish (lol) but I have noticed something in Dhawan which is actually the fact.
Dhawan has been a last match opportunist for most of his career. I honestly believe he has more potential than what he exhibit on the field. Apart from few series and ICC tournments, where he has performed consistently, he has been the last match performer for India. He will play horribly throughout the series and when the time comes and captain and management say, 'hey you have to prove yourself or else you won't be the part of the team in next series', he generates some miraculous power in him and outperforms everyone in that last match of the series. There are many examples for this, research it online and you'll get to know.
He eats up a position of a quality player and later justifies his role through his performance in the last game lol. My question is, if you can perform in the last game, why not perform from start of the series? And if same thing happens to some junior players like Karun Nair or Agarwal or Pandey, they endup warming the bench for whole series and get dropped in the next series. This is the logic of BCCI selection committee.