You know this is a failure of indian foreign policies. Pakistan, Sri lanka, bangladesh or china, no one has strong politcal relations with india, like we have with russia. Even if we leave china and pakistan then too, we are a failure in case of Sri lanka, bangladesh and nepal.
If Afganistan is developed with democracy then Taliban will not get much space to train it's guys and that will help india.
It also works in another way like india didn't show much interest in supplying wepons to sri lanka so they moved to pakistan for the same. Now pakistan has one another place around india to spread it's fake and stupid ideas.
Our presence in afganistan is giving us the similar kind of benifits.