He did go after marathas after their attacks on what was considered durrani empire territory. He was never there to help mughals. If you read about him u will know he was with king nader shah when he attacked delhi. Also the areas of Peshawar to lahore multan were taken by ahmad shah from mughals. The mughals had to cede the area or face an attack on delhi. Pashtuns have never been friends with mughals, they had occasional alliances here and there but always been mild adversaries. When he denied taking Delhi throne, it was left for mughals and destruction of marathas made mughals stronger.
Many scholars argue about his wish to refrain from going further east and taking the delhi seat. He even makes it evident in his poetry. Had he gone on to take over all of india, im sure brits might not have succeeded in taking india. The brits were absolutely scared of durrani empire and its might, its evident from reports of company officer notes. They referred to ahmad shah as the poet warrior.