A single ant can’t do much on its own, but an ant colony can solve complex problems, like building a nest and finding the shortest path to a food source.
But sometimes, things can go wrong. In a crowd, diseases spread more easily, and some swarming organisms may start eating each other if food is scarce. Even some of the benefits of swarms, like more efficient navigation, can have catastrophic consequences. Army ants are one example. They lay down chemicals called pheromones which signal their neighbors to follow the trail. This is good if the head of the group is marching towards a food source. But occasionally the ants in the front can veer off course. The whole swarm can get caught in a loop following the pheromone trail until they die of exhaustion.
From the TED-Ed Lesson Why do animals form swarms? – Maria R. D’Orsogna
Animation by Matt Reynolds