Fish shoal under attack
These surgeonfish are shoaling. They are swimming somewhat independently, but in such a way that they stay connected, forming a social group.
These bluestripe snapper are schooling. They are all swimming in the same direction in a coordinated way.
In biology, any group of fish that stay together for social reasons are shoaling (pronounced /ˈʃoʊlɪŋ/), and if the group is swimming in the same direction in a coordinated manner, they are schooling (pronounced /ˈskuːlɪŋ/). In common usage, the terms are sometimes used rather loosely. About one quarter of fish species shoal all their lives, and about one half shoal for part of their lives
Fish derive many benefits from shoaling behaviour including defence against predators (through better predator detection and by diluting the chance of individual 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).