http://en.wikipedia.org/wiki/Ahmad_Shah_Durrani
Apparently Raghunath Rao had defeated Abdali's son Timur and driven him out of Lahore.The victory at Panipat was the high point of Ahmad Shah's and Afghan power. His empire was among the largest Islamic empires in the world at that time. However, this situation was not to last long; the empire soon began to unravel. As early as by the end of 1761, the Sikhs had begun to rebel in much of the Punjab. In 1762, Ahmad Shah crossed the passes from Afghanistan for the sixth time to crush the Sikhs. He assaulted Lahore and Amritsar. Within two years, the Sikhs rebelled again, and he launched another campaign against them in 1764, resulting in a even battle. During his 8th Invasion of India, the Sikhs vacated Lahore, but faced Abdali's army and general, Jahan Khan. The fear of his Indian empire falling to the Sikhs continued to obsess the Ahmad Shah Abdali's mind and he let out another campaign against Sikhs towards the close of 1766. This was his eighth invasion into India. The Sikhs had recourse to their old game of hide and seek. They vacated Lahore, but faced squarely the Afghan general, Jahan Khan at Amritsar, annihilating the Afghans, with six thousand of Abdali's soldiers killed. Jassa Singh Ahluwalia with an army of about twenty thousand Sikhs roamed in the neighbourhood of the Afghan camp plundering it to his heart's content.
In the spring of 1761, Ahmad Shah, returned to Kabul; and from that period, up to the spring of 1773, was actively employed against foreign and domestic foes; but at that time his health, which had been long declining, continued to get worse, and pre-vented his engaging in any foreign expeditions. His complaint was a cancer in the face, which had afflicted him first in 1764, and at last occasioned his death. He died at Murghah, in Afghanistan, in the beginning of June 1773, in the fiftieth year of his age. He was succeeded by his son, Timur Shah Durrani.
I will try to dig up Airavat's blog post on the battle of Panipat. Would be interesting to know why the Marathas lost. A lot has been written about their lack of allies, overconfidence etc.
Also, we take for granted that the relative peace India enjoys now and how the western border is so well defended. Look at the amount of violence it was subjected to from invaders from the west in the 1700s.