Stirrups were made possible by the development of the saddle.
Without a saddle to attach stirrups to, the weight of the rider standing in them is not distributed over a large enough area and makes the horse's back sore.
A precursor of the stirrup, a toe-loop, was invented in India maybe as early 500 BCE, a time were decent saddles were not yet around.
The nomads of central Asia or northwest China probably invented the proper stirrup somewhere around 200 - 300 CE.
It reached Europe much later, around 700 CE, where it helped the rise of cavalry, culminating in the Medieval knights.
Several historians think that it was the stirrup was a prerequisite for the heavy cavalry charge with a couched lance, but that has been disproved.
The saddle, if equipped with a good cantle, is much more important for that type of combat.
Stirrups however do increase the stability of the rider on his steed, making him less likely to be unhorsed.
They allow him to stand up and from that position fire a bow, or strike with a melee weapon from a greater height and with greater force.
War Matrix - Stirrup
Roman Decline 120 BCE - 480 CE, Weapons and technology