Cavalry could not break many infantry formations. You were safe in a square.
Cavalry was great at harassing supply lines in raids, and importantly running down fleeing infantry.
This is all purely a European perspective, steepe cavalry was very different, but many of their benefits were at a larger scale than a single battle.
Generally the whole thing is too complicated to draw some simple conclusion from. War is, and always has been complicated and messey, not a game of chess.