A herd is a large group of animals. The term is usually applied to mammals, particularly ungulates. Other terms are used for similar phenomena in other types of animal. For example, a large group of birds is usually called a flock (this may also refer to certain mammals as well) and a large group of carnivores is usually called a pack. In addition, special collective nouns may be used for particular taxa: for example a flock of geese, if not in flight, is sometimes called a gaggle. However, in theoretical discussions in behavioural ecology, the generic term "herd" is used for all these kinds of assemblage. A herd may also refer to one that tends and cares for such groups (i.e. shepherds tend to sheep, and goatherds tend to goats, etc.).
When an association of animals (or, by extension, people) is described as a "herd", the implication is that the group tends to act together (for example, all moving in the same direction at a given time), but that this does not occur as a result of planning or co-ordination. Rather, each individual is choosing behaviour that corresponds to that of the majority of other members, possibly through imitation or possibly because all are responding to the same external circumstances. A herd can be contrasted with a co-ordinated group where individuals have distinct roles. Many human groupings, such as an army detachments or sports teams, show such co-ordination and differentiation of roles, but so do some animal groupings such as those of eusocial insects, which are co-ordinated through pheromones and other forms of animal communication. Conversely, some human groupings may behave more like herds.
The question of why animals group together is one of the most fundamental in sociobiology and behavioural ecology. As noted above, the term "herd" is most commonly used of grazing animals such as ungulates, and in these cases it is believed that the strongest selective pressure leading to herding rather than a solitary existence is protection against predators. There is clearly a tradeoff involved, since on the one hand a predator may hesitate to attack a large group of animals, while on the other a large group offers an easily detected target. It is generally believed that the most important protective factor is risk dilution - even if a predator attacks the herd, the risk for any individual that it will be the victim is greatly reduced. In the case of predators, it is often unclear whether the term "herd" is appropriate, since there may be some degree of co-ordination or role differentiation in group hunting. Predator groups are commonly smaller than grazing groups, since although a pack may be more effective at pulling down prey than a single animal, the prey then has to be shared between all members, so that the weaker animals will often be better off hunting smaller prey on their own.
The term has acquired a semi-technical usage in behavioral finance to describe the largest group of market investors or market speculators who tend to 'move with the market,' or 'follow the general market trend.' This is at least a plausible example of genuine herding, though according to some researchers it results from rational decisions through processes such as information cascade and rational expectations. Other researchers, however, ascribe it to non-rational process such as mimicry, fear and greed contagion. "Contrarians" or contrarian investors are those who deliberately choose to invest or speculate counter to the "herd".