The intelligence sharing deal between ISI (Inter-Services Intelligence) and NDS (National Directorate of Security) in May was hailed as a game-changer. Finally, Pakistan and Afghanistan would work together to combat terrorism beyond political photo-ops. Ashraf Ghani, Islamabad raved, was no Hamid Karzai with his Delhi hotline. He was a people-pleaser who talked bitter rival Abdullah Abdullah into a unity government.

A month later, Ghani bared fangs that shocked Pakistan. Speaking at a conference in Doha, he blamed Islamabad for "an undeclared state of war for the past 14 years." The border skirmish at Angoor Adda on June 30 furthered his claim. The Afghan interior ministry said illegal construction by the Pakistan army had triggered the exchange. Some neighbourly cooperation this was turning out to be.

Ashraf Ghani's puppy love for Pakistan is clearly over. On his state visit in November 2014, Ghani praised the country's anti-terror plan and its sacrifices. He gushed then "Afghanistan wants to bolster security and defence ties with Pakistan." It was a whirlwind romance.

The civilian and military leadership in Pakistan too sighed with relief because, "In the end, they all found Karzai too difficult." Now, with Afghanistan lodging a formal protest with Pakistan's ambassador to Kabul, the Angoor Adda episode has taken us back to the start. The question is, was Karzai ever the real problem?

Though Afghanistan and Pakistan have historical issues dating back to 1947, their present impasse is summed up easily. Kabul claims Islamabad does not want democracy in Afghanistan, while Islamabad believes Afghan democracy has no future. It is a thin line with massive consequences. These beliefs shaped how both countries conversed in the Karzai years.

Pakistan, especially the army, takes a dim view of Afghan democracy without American muscle. After US troops leave Afghanistan in earnest by 2016, it expects Kabul to fall to the Taliban. Even now, barring the capital and Persian-speaking provinces, a large part of the country is lawless.

The Taliban, too, smell blood, and have ramped up their attacks. Reasonably, the Pakistan army does not want to back a lame horse. It would be a problem if the Taliban succeeded, and no ties remained with the returning champs. That would undo years of "strategic depth." The rise of ISIS in Afghanistan also worries Islamabad.

Unlike the Taliban's simple jihad against foreign invaders, Al-Baghdadi dreams of a pan-Islamic caliphate across Asia. Since Afghan Pashtuns continue to reject the Durand Line, they would make easy allies for ISIS to attack the Pak-Afghan border. For Pakistan, this is a case of the lesser evil. It cannot afford to make enemies of both the Taliban and ISIS.

Hamid Karzai's problem with Pakistan was more than a sum of his Indian education and rabid nationalism. To his mind, since the Soviet jihad in the 1980s, Pakistan had treated Afghanistan as part of its territory. To counter its influence, Karzai reached out to India, which gladly obliged with investments and increased diplomatic presence. Pakistan, of course, believed RAW came along with the package. True to type, Karzai dismissed the ISI-NDS deal as "embarrassing," and called for its "immediate termination."

Ashraf Ghani was supposed to be different. As a former World Bank moneyman, he was supposed to meet Pakistan halfway all the time. It looks like his patience quickly wore out. Ghani, in a pointed remark in March, said: "the problem is not about peace with Taliban, the problem is peace between Pakistan and Afghanistan."

Since January this year, China has become a partner in the Afghan peace process. With the US itching to leave, this has no doubt happened with President Obama's blessing. Reportedly, the latest round of secret talks between the Afghan government and Taliban took place in Xinjiang on May 19. Chinese officials and members of the ISI also participated in this meeting.

On the surface, this is a great idea. China, right now, has the kind of broadband sway with Islamabad that Washington never had. It also has significant money tied up in Afghan infrastructure, and its own concerns about Islamic radicalism. The Uyghur East Turkestan Movement threatens to boil over, and SCO-partner Russia worries about ISIS in Central Asia. In short, China has every reason to want this problem solved.

Of course, this is easier said than done. The Afghan Interior Minister, Noorul Haq Ulomi, recently revealed that a motley crew of radical foreigners had set up camp in northern Afghanistan. He blamed the Pakistan army's cleanup campaign for pushing these terrorists inside Afghan borders without warning. The information sharing system, if operational, is clearly out of sync. To be fair, Pakistan's foreign policy spokesperson, Tariq Fatemi, had earlier clarified the country "did not and cannot promise anything."

There is much talk of a widening trust deficit between Pakistan and Afghanistan. I do not believe there was much trust to begin with. After all, how can Pakistan completely trust the only country that voted against its inclusion in the UN? That rejected the northwestern frontier province as part of its geography? Similarly, how can Afghanistan truly forgive Pakistan's role in three decades of war? That is a hard ask of individuals, much less nations.