 Many teleosts form shoals , which serve multiple purposes in different species . Schooling is sometimes an antipredator adaptation , offering improved vigilance against predators . It is often more efficient to gather food by working as a group , and individual fish optimise their strategies by choosing to join or leave a shoal . When a predator has been noticed , prey fish respond defensively , resulting in collective shoal behaviours such as synchronised movements . Responses do not consist only of attempting to hide or flee ; antipredator tactics include for example scattering and reassembling . Fish also aggregate in shoals to spawn . 
