Many units are Impetuous. It means that they can charge without orders, if they have an enemy nearby. Sometimes its hard to make such unit disengage from an enemy. I'm not saying this is what happened, but you should also take this into account when "walking" impetuous cavalry near enemy units.