References to the Jats in Pre Mughal history are far & few. But whenever they do appear in lit they normally appear as resisting one or other Islamic army descending from Hindu kush over plains of India. So for eg. When Ghazni was retreating from Somnath, his army was heavily harassed by the Jats. As a result, Ghazni’s last expedition in India was against the Jats in Multan in which many Jats perished. Similarly, more than 5000 Jats from upper doab & Braj also participated in the battle of Sikari against Babur on the call of Rana Sangha of Mewar. Whether Ghazni, Ghori, Babur, Timur, or Nadir Shah, they resisted them all undeterred by the heaviest odd or their terror-inspiring fame.
We all know about Samarth Guru Ramdas who acted as the spiritual guide for Shivaji in his war against dharma. One lesser-known fact is that the same Samarth guru Ramdas also inspired the Jats to throw away the tyranny of Aurangzeb as recalled in the Sakhas - bardic Jat literature. Inspired by the mighty Guru, some 20000 peasants, mostly Jats, of Mathura & surrounding regions led by Gokul - Jat Zamindar from Tilpat rose in rebel against Aurangzeb in 1669. It was soon crushed, however. Many Jats were slaughtered & many Jat women committed Jauhar. To their credit, however, they tried to take on Aurangzeb under the very shadow of imperial capital when Mughal power was at its height. Later on, Raja Ram Jat & his fellows desecrated the tomb of Akbar at Sikri, dug out his bones & burned them to avenge that brutal massacre.
Jat war against the Mughals turned out to be the miniature version of the disastrous Mughal expedition against Marathas in the Deccan ut after a long & protracted struggle Jats eventually managed to carve out their own territories out of the former Mughal capital region. In the chaotic times of the 17th & 18th centuries, when Delhi was often attacked by the ravaging Islamic armies, those Jat territories often provided asylum to the people seeking protection from barbarians. Their role is especially admired in protecting refugee feeling from Panipat. Many scholars suggest that had Suraj Mal - Jat ruler of Bharatpur wished otherwise probably not a single soul would have reached Deccan alive. It is also worth mentioning that Khap Panchayats played an important role in raising the Jats in revolt against oppressive Islamic regimes.
“Jats came from Jata (hair locks) of Shiva. We were born to sacrifice the last drop of our blood to protect Hindu dharma” - Maharaja Surajmal Jat
Source: https://twitter.com/i/events/886381027622621184 and “The Jats: Their Role in the Mughal Empire” by Dr. Girish Chandra Dwivedi