Better drivers though!
Quite simply, good quality cavalry would roll raw or confused infantry in short order. However good quality infantry which was trained to absorb the initial shock is a different kettle of fish.
A guy with with a big pole in both hands astride a trotting horse, will push an infantrymen over or backwards. Especially when the horse is big and like a mini tractor. The torque of that shove is something else.
However if the men behind the front rank brace it and and the ranks keep their head. And the horse has no momentum anymore then the infantry will gain the upper hand. However if the infantry recoils, then cavalry has space to move forward for another nice shove. Enough shoves and the infantry is having a bad day.
Don't under rate the ability of suitable cavalry to exert pressure.
The success of the Huns was in part due to a heavier breed of horse over 15 hands, compared the gracile Arabs of 14 hands and under the Romans were riding.
However men can ultimately recoup their energy, where as a horse can remain exhausted for the rest of the day. It pays to have remounts.