We aren’t sure where the stirrup came from. Like many things and peoples during the Migration Era and the Fall of the Roman Empire, it probably came from the East. It might have had Central Asia for origin, since that is where the invention of cavalry originates.
We know that, using stirrups, knights were able to sit firmly on their horses, couching their lance under their armpit and deliver devastating power which could pierce mail armour and break shield formations. This made cavalrymen even more valuable, and brought the title of knight to honored glory.
Medieval infantry was always vulnerable to the knightly charge, until of course the advent of gunpowder. However, foot soldiers still fought in cohesive formations, and maybe more so than ever, since you wouldn’t want to turn your back to charging knights with couched lances. Routing would certainly mean your end.
In response to this, small groups of mounted knights would charge at the enemy in surprise hit and run attacks, hopefully inflicting a high rate of casualties on the disorganized men.
Knights weren’t invincible though, and the horses either. The horses were in fact a prime target because a dismounted knight, especially a prone knight, is more vulnerable. Even then, we don’t see horse armor being developed as quickly as human armor. There’s always the problem of weight and mobility. As horses wore heavier armour, they grew bigger and stronger, and thus the cavalry charge became more dangerous as more weight and power was behind it.