Pakistan's relations with Afghanistan were never great until 1996, when the Taliban gained power in Kabul. India provided technology, equipment and medical support to the Northern Alliance during it's fight against the Taliban. Aside from gaining a seat at the table at the Bonn Conference in 2004, India has managed to support both the Karzai regime and Tajik challenger Abdullah Abdullah. Several government ministers are well disposed towards India.
Now aside from India's goal of keeping the Pakistani threat in check on on their shared and contested border, there also lies the problem of Indian support and relations among the Tajik leadership in northern Afghanistan, where there is serious discontent over what appears to be [by nearly all accounts] a fraudulent election of Hamid Karzai [Pashtun from the south]. Some reports have indicated an influx of arms moving into the north to the various Tajik warlords. I'm not predicting civil war...but that dynamic cannot be discounted, as the government in Kabul is increasingly seen as corrupt, powerless and a puppet regime.
India is heavily invested in the reconstruction and economic aid to Afghanistan, to include the deployment of the Indian Border Road Organisation (BRO). The BRO has security provided for them by the Indo-Tibetan Border Police Force. This isn't akin to the Indian Army itself being deployed....but you can sense Pakistan's concern over the influx and influence .
A List of India's Involvement in Afghan Reconstruction:
• Around 400 BRO personnel involved in Zaranj-Delaram highway.
• Afghanistan's Parliament Building
• Power transmission line from Pul-e-Khumri to Kabul
• Reconstruction of Salma Dam power project, Herat
• Telephone exchanges in 11 provinces
• Televison network uplink from Kabul, downlinks in all provincial capitals
• CII project for training 3,000 Afghans in vocations ranging from carpentry, plumbing to masonry and tailoring.
[The list is not exhaustive though, there are other projects with active Indian participation]
Pakistan's largest fear is that India will use it's influence to aid Pakistani militant groups withing Baluchistan; groups intent on undermining or overthrowing the government in Islamabad. Since we recognize the imperative of convincing Pakistan to fight against extremist groups within it's own borders, we realize that this cannot happen while Pakistan views India as it's overwhelming threat, not only in terms of nuclear arsenals or the disputed territory of Jammu and Kashmir, but also the threat on it's western frontier.
A good primer for India's role and relations in Afghanistan can be found in this issue paper by the Center for Strategic and International Studies.