The term swarm (shoaling, swarming or flocking) is applied to fish, insects, birds and microorganisms, such as bacteria, and describes a behavior of an aggregation (school) of animals of similar size and body orientation, generally cruising in the same direction. Group size is a major aspect of the social environment of participants.
Swarming of honey bees is a more specific term, referring to the reproductive action of an entire colony of bees (as opposed to the reproduction of single bees); see Queen bee and Honey bee life cycle.
Shoal can describe any group of fish, including mixed-species groups, reserving "school" for more closely knit groups of the same species swimming in a highly synchronized and polarized manner.
Fish derive many benefits from shoaling behaviour including defense against predators (through better predator detection and by diluting the chance of capture), enhanced foraging success, and higher success in finding a mate. It is also likely that fish benefit from shoal membership through increased hydrodynamic efficiency.
Fish use many traits to choose shoalmates. Generally they prefer larger shoals, shoalmates of their own species, shoalmates similar in size and appearance to themselves, healthy fish, and kin (when recognized).
The "oddity effect" posits that any shoal member that stands out in appearance will be preferentially targeted by predators. This may explain why fish prefer to shoal with individuals that resemble them. The oddity effect would thus tend to homogenize shoals.
One puzzling aspect of shoal selection is how a fish can choose to join a shoal of animals similar to themselves, given that it cannot know its own appearance. Experiments with zebrafish have shown that shoal preference is a learned ability, not innate. A zebrafish tends to associate with shoals that resemble shoals in which it was reared (that is, a form of imprinting).
Other open questions of shoaling behaviour include identifying which individuals are responsible for the direction of shoal movement. In the case of migratory movement, most members of a shoal seem to know where they are going. In the case of foraging behaviour, ethologist Stephan Reebs, writing in the journal Animal Behaviour, reported that captive shoals of golden shiner (a kind of minnow) were led by a small number of experienced individuals who knew when and where food was available.