According to Gulshan-i-Ibrahimi (written in 1612 AD), Afghans (Pashtuns) and Khaljis formed the vanguard of the army of Sultan Shahabuddin Ghori. The Pashtun and Khalji commanders of the vanguard (مقدمة الجیش), who always boasted of their valour and prowess, fled from the battlefield (along with the right and left wings of the army) in the first battle of Tarain (1191), leaving the Sultan with the centre of Army (لشكر قلب).
Another interesting detail from Gulshan-i-Ibrahimi (or Tarikh-i-Farishta) is that after the defeat in the first battle of Tarain, Sultan Shahabuddin severely punished and humiliated his nobles from Khalj, Ghor and Khorasan who fled the battlefield, but he spared Afghan (Pashtun) Amirs out of prudence.
In the second battle of Tarain (1192 AD), the 107,000 strong army of Sultan Shahabuddin of Ghor was comprised of Turks, Tajiks and Afghans (Pashtuns).
The 300,000 strong cavalry of Rai Pithora (Prithviraj) in the second battle of Tarain (1192 AD), was comprised of Rajputs and Afghans (Pashtuns).
So Pashtuns were fighting on both sides. For this reason, Sultan Shahabuddin exercised caution in his dealings with his Pashtun amirs. He did not punish and humiliate Afghan (Pashtun) amirs for fleeing from the battlefield in the First battle of Tarain, perhaps fearing that the latter may switch allegiance to Rai Pithora.
The above snippets are taken from an Urdu translation of Gulshan-i-Ibrahimi (popularly known as Tarikh-i-Farishta). Its author Muḥammad Qasim Hindu Shah was born in Astarabad in northern Persia around 1550 AD. Farishta was his pen name.