There goes a comparison, an analogy:
Do (did) you go in for boxing? Or any other hand-to-hand martial arts like karate, kung fu, whatever?
If not try to ask a friend of yours who does: "Can a small guy beat a big guy with bare hands?"
Your friend will provide you with a dozen of examples when small guys swept the floor with big guys. And then he'll provide a couple dozen more (when a small guy kicked big guy's ass). And some more on top (when a small guy gave a dusting to a big guy).
But in the end he'll confess that with all other things being equal a big guy always has an advantage over a small guy.
The same with cavalry frontal charge against prepared disciplined infantry - with all other things being equal in such situations infantry always has an advantage.
The bigger man generally has a pronounced advantage with (close combat) weapons too, actually, not just bare hands. But that's not really that great an analogy.
The very fact that you have to qualify the infantry as being prepared and disciplined makes me question the usefulness of the whole comparison exercise. Why don't we talk about cavalry needing to be perfectly prepared and disciplined? If anything there's a lot more that needs to be managed in a cavalry troop.
Here's what I need answered:
What was the point of investing so much resources into mounted warriors? Not only mounted warriors but mounted warriors specifically armed with shock weapons?
Every culture that had access to horses did it, without exception. Some cultures (the Saheli kingdoms, China, Japan etc.) did not have easy access to horses and yet they spent huge money and effort acquiring them and training fighting men on horseback, generally armed primarily with lances or swords.
Why?
What would be the point of spending all this effort on something that wins *despite* being mounted, when "all things being equal" infantry has the advantage?
Why did the entire world - the entire world - throughout the entire human history - decide to spend so much effort on the less efficient option?
Well, two answers are possible:
1. Everyone was irrational everywhere until the invention of machine guns and trucks...or,
2. Cavalry is a viable independent arm on top of being a tremendous force multiplier, and so well worth the investment, and in the real world "disciplined and prepared" infantry is far from being common enough to alter that calculation.
I know which one makes sense to me.