How living systems compute solutions to problems

How do decisions get made in the natural world? One possibility is that the individuals or components in biological systems collectively compute solutions to challenges they face in their environments. Consider that fish navigate complex environments to find food and escape predators. Some fish do this by moving together as a unit, sometimes forming incredibly organized schools. The members of a beehive are collectively able to determine which of two nest sites is better. Humans are able to make accurate, coherent decisions even though the process underlying those decisions may involve billions of neurons, each with its own opinion. There are no leaders in these groups and different individuals have different preferences about where to go or what to do. No individual fish or bee or neuron has enough information by itself, but together they can accomplish amazing things. How is this possible?