The Rajput Kingdoms fought off the invading Abbasid Arabs, who had just conquered Iran, from the 600s AD to about 1000 AD. But then the Abbasid army succeeded in invading and taking control of a large part of northern India (and what is now Pakistan). Little by little, many Hindus and Buddhists in northern India decided to convert to the Islamic faith of their new rulers.
The Arabs set up a very successful government in northern India. But their government didn't last very long. By about 1100 AD it was taken over by the Delhi Sultanate.