It's more complicated than that.
Cavalry pre WW1 was still a charging unit armed with lances and swords as well as pistols. Their power was still as always, in flanking the weaker parts of an enemies sides or rear and using the force of the charge to break the enemy and force them into retreat.
But the invention of the belt fed machine gun spelled the …