Takhya is coffin. The Afghans and all other central Asian peoples always say that the throne is either Takhta(Great seat) or Takhya(Coffin), which of this is applicable is dependent on the ability of the ruler to exert Authority.
But despite being much better than his internal competitors, Dost Mohammed found himself on the Takhya.
In February 1825, the Khan of Kunduz(The Durrani puppet directly above Kashmir in the map above), rebelled against his authority. Worse still, some of his Barzakai relatives also supported the revolt. While he started making preparations to march on the rebels, the Shah of Persia, his eyes fixed on the principality of Herat declared war.
The end result was that, Herat gained independence and so did Kunduz, this dealt a massive blow to the Empire. Furthermore, his supporters started whispering that since Dost Mohammed wasn't really a Durrani, he had no right to the title of Emir of Afghanistan.
Meanwhile, back in the Punjab, Ranjit Singh coerced several great Hindustani Inams to read the Kuthba(Declaration of royalty) of Afghanistan in his name.
Ranjit Singh greeting Inams.
This meant, that now he was a lawfull contender to the Afghan throne.
In May of 1825, he threatened the Khan of Kunduz to submit himself to Sikh authorty or risk a war to end his 'Rouge State' .
The Khan had nowhere the military might of the Sikhs, but he was sure of two things.
1)The Sikhs would be unable to march from Kashmir to Kunduz with their huge pompous armies.
2)His Muslim brothers, though hating him, would come to his aid in the face of this aggression by an infidel.
To Further increase his chances, he decided to take the tough decision of swearing fealty to Dost Mohammed again.
He began the negotiations sometime between 27th May and 3rd June.
Back In Punjab, Ranjit Singh knew that attacking Kunduz via Kashmir with a large army through Inhospitable climate was indeed a bad idea.
For several days he pondered over idea after idea. His generals, advisors and diplomats all tried to help, but for once it looked like Ranjit Singh was failing.
Just as he was going to take the vain decision of leading the army himself and sacrificing hundreds of men through barren terrain, his top general Hari Singh Nalwa chipped in.
Nalwa's idea was revolutionary. He Claimed that the Khan of Kunduz only had about 2500 reliable men. Marching a huge army to Kundiz was unrealistic, so he offered to lead a very small punitive force of just 2000 elite lancers of the Khalsa without any artillery and infantry and ambush the Khan's camp.
Thus, by killing the Khan, the war would be over fast.
It was a risky feat to do. But he wasn't called Hari Singh Nalwa for nothing.
He had first been recruited in Ranjit's service when he had beaten 4 of the most powerful wrestlers of Punjab at once in 1808.
Ranjit Singh thought that since Nalwa was confident, they would pull it off.
Hari Singh Nalwa in 1824.
Hari Singh Nalwa(The man with the big beard standing behind) posing for a rare photo in much later years(1871)