The horse was just correcting you then (in its mind obviously). I've seen a horse correct a dog before with a kick and the dog was like whoah that sucked won't do that again. I've also heard stories of dogs harassing horses to the point where the horse is really pissed off, gives them the full double barrel, and at that point the only humane option is euthanizing the poor dog.
One of the newer John Wick movies showed what a pissed off horse can do in memorable style.
Either the sound was added later or those were exceptionally well trained animals. Probably both.
My brother did civil war reenactment and there was a lot of black powder exploding and they managed to train the horses to tolerate it. But it definitely took training!