I know that infantry was very important during the periods between 500-1400 ce, but cavalry was much more important. New infantry techniques like the Swiss battle square, phalanx, the Persians tactical system... etc made it extremely difficult to defend against well organized armies but what exactly (if anything) made the use of cavalry so dominant. Innovation of new armor, better weapons, and the emergence of the longbow all helped the emergence of infantry, but what was it about cavalry that made it such a force to be reckoned with during these times?
If you're looking for changes in arms and armor to explain the importance of heavy cavalry in the Middle Ages, I'm not surprised you don't see much connection. You'll want to look in a different direction: in the way state power was organized. But let's take a brief detour first to talk about cavalry vs infantry.
The technique for infantry to defeat cavalry is fairly simple: assume a formation where they cannot flank you and then hold that formation. The main power of cavalry is psychological: it's awfully hard to stand there holding a spear when a mass of horses and men is speeding toward you. That horse outweighs you by, what, 10 times? At 30 mph that's a lot of momentum. And the man on top isn't going to help matters. You're going to want to get the heck out of the way. But that's exactly the wrong thing to do. If your formation breaks and runs, the horses can maintain speed and maneuverability, and they'll cut you down from behind. Cavalry is just absolutely superb at slaughtering scattered fleeing men, as they get to control every individual engagement due to the speed of the horse.
But if you (and, crucially, the rest of your line) stay put, the horses are going to stop one way or the other. Either with a spear in them or because they, quite sensibly, decide not to run into what is essentially a solid object: your dense formation. A horse is not a battering ram or a tank. (Some will say that horses simply will not run through people. I expect that's true of many horses, but I tend to think that a pumped up and aggressive destrier probably will dive into your formation. But it won't get far if you don't let it.) And once a horse is stopped amongst hostile infantry, its main advantage, speed, disappears, and now you've got a big awkward fighting unit with few advantages and a couple big drawbacks, and is probably also outnumbered. And that's if the horse hasn't stopped because it's been killed or wounded; the dismounted rider isn't going to be doing much better.
So if that's how it's done, why does cavalry matter at all? Because, frankly, both parts of the formula (assume a proper formation and don't break it) are really hard to do and require a well-organized and cohesive army. The first part, in fact, may be the hardest. Getting an army that you can order to form a square or reorient to face a charge takes a lot: the doctrine to know you should do so, communications to relay the order, a chain of command to carry it out including lots of competent officers and NCOs, units of reasonably uniform size, and lots of training and drills. This may not sound like a big deal to modern ears, because we assume these to be inherent characteristics of an army, but it's really an outcome of a long process of development and comes at a fairly enormous cost.
So let us consider the Medieval European state. (To the extent that one can generalize, this being a very large span of both time and geography. Almost everything I'll say here will be wrong in various times and places. But it's a general question so we'll do a general answer.) Don't worry, we're getting to the army. Say you're a king, or would-be king, and have gained possession of a large territory. There's not many people around who can read, much less write, and you couldn't really afford many of them anyway. You also have a pretty fair band of armed followers and friends who you owe for helping you take over that territory. How are you going to organize your kingdom? It's far too large for you to personally visit even all the market towns, much less all the villages and hamlets and individual farms--and personal relationships is how governance gets done under the circumstances.
What you do is give fairly large chunks of land to your followers. Not quite large enough that they'll become powerful enough to threaten you, but also not so small that that you'll have too many people to directly manage. Probably you use existing administrative divisions, because that'll be easier. Of course, those people (who may be styling themselves based on the old Roman administrators as "Dux" or "Dukes") have a similar problem, and solve it in a similar way, granting portions of their land to their followers, and so on down the line until you have landholdings small enough to personally manage.
This is a fantastic system for managing a state if you have little or no bureaucratic infrastructure. All you need to know is your direct superiors and inferiors and what they owe and what you own.
But of course you don't just give away that land. In return they owe you something. The deal will vary. It could be money, but that's a lot of book-keeping, and there's not so much money floating around. Generally, you'll want them to do things for you--to pay in kind, as it were. Maintain the roads and bridges, keep the peace, dole out justice. And also, provide armed service when needed. These are, after all, the people with money, and going to war is expensive, and theoretically they earned their position through warfare already. But they're not going to stand being in the army all the time; their primary business is land ownership, and those peasants aren't going to exploit themselves. So you have a deal where you can call them up for a limited time, say 40 days, and then they're done. That ought to be enough to deal with most emergencies.
So when you want to raise an armed force you call in those people who owed you armed service. Your handful of Dukes might make for a good raiding party, and they'll be armored like nobody's business, and they should be keeping in fighting shape, but they won't make for much of an army by themselves. But don't worry, they bring all their dependents, and they bring in all theirs, and so forth until you have an army.
Those who are in the nobility will be well-provided for, and arm themselves as heavy cavalry (which is stupid expensive, but you've made them all wealthy enough to afford it), and be personally skilled and trained. They might even have some concept of heavy cavalry unit tactics. The infantry will be from the lower rung of the social and economic ladder. Maybe some small landholders, or townsmen, or even peasant levies. Some of them may have fought before, but they're even less professional soldiers than the nobility.
As King (or Duke, or whatever) you've got your army, but it has some particular characteristics. There's no particular unit size or composition: units come in under the leadership of the people who raised them, and they correspond in size to the economic power of those leaders. They haven't trained together, and don't have time to do much now. Their main motivation is loyalty and personal connections, but many of them will not be highly motivated, especially on the lower end of the ladder.
When your infantry, thus composed, encounters heavy cavalry, you're going to have problems moving them around. Your main method of command is riding your horse about yelling and/or just having your followers follow your banner, with maybe a few simple trumpet signals if you're clever. They're not drilled well enough to turn the line and stay orderly. (You may even count yourself lucky to be able to advance in formation.) The unit sizes vary so widely I don't think anyone knows where they would go in a square even if you thought they could carry out that order. And when the knights charge home, do they really have the discipline and training and esprit de corps to stand and let the charge break on their formation?
This is not to say infantry never beat cavalry in the Middle Ages. Far from it. In the right conditions, on the right terrain, with good supporting arms or good doctrine or commanders et al infantry could and did beat cavalry. (And I'll note I've completely skipped all mention of ranged arms here, just because this is too long already, and that is a whole other complication.) But it does suggest some reasons for the importance of knightly cavalry during the period. For one, because of the way states and armies organized, infantry tended to have characteristics that made it vulnerable to cavalry. In periods of more elaborate state organization (like the Romans before or Early Modern states after) infantry had better effectiveness against cavalry, which then took on roles of flanking, scouting, and cleanup rather than shock attack. And for another, perhaps equally important: all the cool kids were knights. The rich wanted to have the best weapons system going, and that was heavy cavalry. So as long as they were personally involved in warfare, heavy cavalry was going to be important.