My impression was that a plate armoured knight had enough impact at full charge to be able to simply trample any infantry short of pike or haleberd that came in it's way. If impalin your enemy didn't do the trick, a ton or two of horse, rider and armour ought to do the trick.
Well, it's a race between them. Heavy cav. can punch through most things if doing it right. Otoh already in the Middle Ages you had infantry in tight formations bringing down knights with poleweapons and killing them with daggers. This was a favourite tactic of mercenaries already in the 12th c.
There was an aspect of class warfare involved too. Nobles wouldn't kill but capture each other for ransom. The mercenaries were ever so happy killing them instead using their "ignoble" weapons; polearms, daggers and crossbows. Which meant they were feared and hated by the nobles who tended to massacre captured mercenaries. Hiring mercenaries even troubled the papacy, which condemed the practice (it seems to have upset them how they messed up the social hierarchy.) If anything this indicates that good infantry certainly could handle a fight with the noble cavalry in the MA. In fact you tended to rely on levied pesants and mounted knights partly because better infantry was potentially threatening to the nobles.
This was true for the north French at least. In southern France the great lords tended to wage wars by hiring large amounts of mercenaries to complement their forces. This was actually one of the things specified in the papal declaration of the Albigensian crusade in 1208, that the southern lords had to stop this dangerous practice of hiring mercenaries (besides rooting out the cathar heresy and stop appointing Jews for public office).
There obviously was a lot of things things on a battlefield, and certainly in a siege, which was the most common form of military action of the time, where heavy knights charging was pretty useless.
You can find this in sources like Jean de Joinville's "Life of St Louis", when relating Louis' failed crusade to Egypt, the super-aristocrat de Joinville constantly tries to blacken the king's engineers, a bunch of highly professional commoners, while at the same time it's abundantly clear that the only people who allowed Louis' army to make any headway whatsoever in Egypt was the royal engineers. (You march the army through the Nile delta to the next arm of the river, then the engineers dam the river in front of you and make it pass behind the army, which can go on advancing. Very slow and very hard and difficult work.)
Joinville is also prone to rate a military actions as "noble" or "ignoble" depending on what weapons were used in a fashion that seems typical for medieval warrior-aristocrats. Swords and maces are good. Crossbows, polearms and daggers are bad. He's deeply troubled by watching the kings brother, duke Charles of Anjou, in his frustration over not being able to get at the Egyptian defenders, pick up a crossbow and spend the night taking pot-shots at them across the river. That was stooping to the level of commoners! (Of course Charles of Anjou has come down as one of the big bastards of history.)