Certain things have to happen to an animal for it to behave defensively. These have to do mainly with handling practices. Some of the things that stimulate defensive behaviour in animals are:
Shouting: Most domestic animals are irritated by shouting especially if they are not used to it. For example, dogs that are used to gentle handling can easily bite you because they are stimulated to defend themselves.
Stress: Animals can experience stress as a result of unpleasant environmental conditions. Stress can result in animals showing strange physical behaviour such as defensive behaviour because the animal will become very irritable. Causes of stress can be pain, unfavourable living conditions such as very cramped housing and poor ventilation, and transportation (especially long-distance transportation can cause the animals to be very irritable). However, some animals are more tolerant than others, for example, sheep and cattle are more tolerant to painful stimuli than horses, dogs and cats.
Beating the animal: Beating the animals painfully can immediately stimulate defensive behaviour, especially if the animal is a less tolerant animal such as a horse or dog.
Manipulation: This refers to stressful activities that include vaccination, castration, separation and transportation that can be very stressful to the animals such that their defensive behaviour is stimulated.
Threatening the animal: When animals are purposely threatened, either by your body movements or shouting, it can be an immediate stimulus to an animal to defend itself.
Thus, if you avoid doing these things the chance of eliciting a defensive reaction will be reduced.