Let me break it down to you what India wants to achieve in Afghanistan. They want to have a stooge made out of Afghanistan , a govt with most of its ministers on Indian payroll , Afghan army's top brass on Indian payroll , Pashtuns out of Military brass. Anti Pakistan Afghan intelligence , Anti Pakistan Afghan policies. Suppression of pashtun majority through a minority strong enough to rule them through fist.
Once this is achieved , India would want to have strategic air bases and troops in Afghanistan , intelligence apparatus disguised as "trainers" to brainwash Afghan army against Pakistan from grass root level as well as to make sure the ethnic balance remains against the pashtun majority. Such a situation would allow Indian strategic thinkers to draw up a cold start invasion of Pakistan plan with a "two" front war , ie India and Afghan army attacking Pakistan from both sides at once which has more chance of succeeding "on paper" than India doing it on its own. [Even though it won't succeed on the ground.]
India wants to establish hegemony in Pakistan's strategic backyard , if it is successful , it would strip Pakistan of its options to have a fall back territory in an event of another "blitzkrieg" by India. Pakistan won't look at it as a nightmare scenario as it would NEVER materialize because we wont LET it be materialized. Pakistan wants a friendly Afghanistan , Iran , China to keep India isolated in the region in an event of another war. Moreover Afghanistan is pivotal for Pakistan to access lucrative energy markets in central asia and not to forget our "new found" friend Russia.
If India establishes hegemony in Afghanistan , it will strip Pakistan of its fair share in Eurasian corridor project hence rendering Gwadar , Karachi & upcoming Pasni/jewani ports useless for trade from Russia and Central asia. Even though kicking India completely out of Afghanistan [well & possible] won't be in a complete favor of Pakistan too , a legit Indian presence in Afghanistan which doesn't eliminate our interests can be tolerated.
Regards: