Horses, donkeys, goats, hogs and even roosters will attack you, too. Despite some humans' need to have warm, fuzzy feelings about farm animals, the truth is that they are animals with a thin veneer of "domestication". Each of the species has its own typical instincts and behaviors which cannot be or never has been bred out of them.
I lost a childhood friend in high school to a horse he was riding. He'd owned and ridden the horse for years. One day the horse decided to take him under a tree at a full gallop and it broke his neck when his head hit a tree branch. I've owned horses for over 60 years and I never walk behind a horse close enough for the horse to kick me.
Please understand that I mean no disrespect, but I feel compelled to say that there is a lot more to this story. Yes, "animals" can be killers, but they cannot even come close to the level of malicious killings performed by humans.
It is important to understand that "farm animals" were either born into or captured and forced into a life of slavery. There used to be a time when human slavery was a common thing (actually human slavery still exists in some parts of the world). During that time and for some time after, many humans believed the same thing about human slaves and/or the common race that was enslaved. I still know people that believe certain races of humans are of thin, savage, animal mind, not to be trusted and are dangerous. That is called racism and I like to believe we all agree that racism is a bad thing. I also believe that speciesism is also a bad thing.
I believe this is due to segregation. Even if segregation is not forced by any government, people segregate themselves. It is easy to form negative conclusions when you do not know all the facts. Life is complicated for all creatures - not just humans. It's easy to decide another's mentality when you don't know them. My family and community was (is) very segregated and deeply bigoted.
No one can know what was in the mind of the horse that ran under the branch. Was it truly malicious? Did the horse expect the rider to duck? Or was it an error or miscalculation? A horses direction is typically controlled by the rider. Did the horse divert against the riders control? Was that a favorite route of the horse? Regardless, it can't be truly known what the horse was thinking. We can only guess. I have witnessed many times when a horse that didn't want to be ridden would try to drag the rider off by pushing against a fence. I never believed the horse wanted to harm the rider. He/she simply didn't have any more effective way to communicate that he/she didn't want to be ridden - and probably knew that his/her desire didn't matter as he/she would not be offered the choice anyway.
I am responding to this because it is an intense PTSD trigger for me. (I suffer an extreme PTSD regarding incidents involving my best fiends.) I suffer from chronic social anxiety. Turns out it's human social anxiety. I spent almost my entire childhood (11 years) back in those fields and especially in the deep ravines of the abandoned gravel quarry. (See my post above in this same thread.) Turns out, I never feel any social anxiety or loneliness with all the wildlife and livestock living there. I have always felt lonely in the company of other humans. Spending all the days, months and years of my childhood there with all the "animals" has given me a very different perspective, understanding and respect. I got to know them on a personal friendship level. I have never been able to do that with a human. My perspective is just too different and human society is intolerant to different perspectives. I always knew my cows, horses, etc. friends. would never harm me. They knew me and they saw me. They accepted me. They were free to or not to be my friend. It was entirely their choice. There was no society requirements. There were no leashes, ropes or any form of containment. I never made any requirements of them. Though it was never needed, I feel confident any one of them would have acted to protect me. What I learned is they are people. But, we can never see that as long as we are segregated and are masters or owners, etc.
Sorry. I had to get this out. I'm sure no one will agree and I mean no disrespect. I just had to get it off my chest.