The science is straightforward. Whenever a behavior is common in the animal kingdom, biologists suspect it has an adaptive function. That is, the behavior enabled individual animals to survive better and leave more offspring than animals that did not engage in the behavior. As a result, genes for the behavior spread throughout that population until it became essentially ubiquitous.