Horse are creatures of habit and sometimes they pick up habits that aren't ideal for our riding or living conditions. While we can train our horses to help lessen that habit, it won't ever really go away completely. I am not referring to green horse habits such as traveling high-headed, not picking up the correct lead, or ability to do flying lead changes as asked. Those are considered uneducated horses that just need some training. The habits I am referring to are deeply ingrained habits such as wheeling, taking off, rearing, spooking, as well as stall vices. Those are ingrained habits that the horse has used in the past as their defense to something that may be hard, scary, stressful, or just something they don't want to do. We need to keep in mind a horse does not have a frontal cortex; they cannot think things through to process issues like we can. That is what has kept horses alive all these years: flight mode. So, when a horse is faced with a scary object in the near distance, or leaving the herd (which instinct tells them that is a cry for danger) they do what they can to get back to what they perceive as safety. This is where the undesirable behavior comes into play when we are riding or handling horses. You can fight or school the issue to get the horse over the issue at that time, but their ingrained instincts are very strong and to completely dissolve the issue for future insistences is nearly impossible all the time. We can always improve the issue with time, training and trust, but it will never go away at 100% unless the horse remains in an environment where they feel 100% safe at all times. That is the key word "safe". Does the horse feel safe? Generally if they feel safe, you will have very little issues, unless the horse is sour or sore, then the avoidance will creep up and they will default to their ingrained "safety" habit as the defense. Sometimes we can trick them, or even work with them to lessen the behavior, but when shit hits the fan that habit will come right back around.
Addressing stall habits such as weaving, cribbing, pacing are almost nearly impossible to fix. These behaviors are generally caused by artificial living environments we create for the horse, such as closed in stalls. When horses are in confined spaces, they not only typically feel claustrophobic, but they also cannot use their flight mode to evade what they perceive as danger, they feel trapped and a way they deal with that is by picking up habits. Sometimes you can make them feel more comfortable by putting them in an open pen or pasture, which will lessen the behavior, but once again these are ingrained habits that will come to surface when the horse feels unsafe or stressed. We can only do what we can do based upon our living situations and lifestyles, but thinking outside the box and understanding your horse and their insecurities is the first step to help them lessen the behavior and keep everyone safe. After all, horses are just horses.