Greeks, Arabs, Scythians and Turks easily ruled the major part of Afghanistan and Pakistan for thousands of years and were only defeated in what is modern India. The Arabs and Scythians tried to invade the Deccan but were defeated by the Chalukya and Satavahana Dynasties of the Deccan. Even the Turks struggled in the Deccan and were severalwhen invaders come they dont get free pass to highway 444 straight to Deccan, they had to fight the local tribes from Afghanistan to Punjab before going further inland....Afghanistan, Punjab, frontiers (KPK) were the tribal societies and never submitted to dynesties, they would fight the invaders making them weaker, so invader mostly returned half way with whatever they can get their hands on.
times defeated by the Vijayanagar Empire. All these invaders used Afghanistan and Pakistan as a base to invade India.