When a horse senses danger they will flee the area if possible and by flee the area I mean the horse will if possible start running away from the danger.
If they can get away from the danger that's what the horse will do first to protect themselves from danger.
If the horse is unable to flee from danger the horse will fight back by kicking, rearing, striking and even biting to ward off the danger if possible.
Horses have evolved from smaller mammals and those small mammals survival in the wild depended on the ability to flee or fight back from danger.