Danger from predators causes animals to form stronger friendships, according to new research.
Scientists from the University of Exeter, University of York and University of the West Indies, St Augustine, observed Trinidadian guppies and found the fish developed stronger and more stable social bonds when they thought predators were in the area.
Intriguingly, this also coincided with social groups being smaller - suggesting a possible conflict between being able to form strong social relationships and being able to live in larger social groups.
This is the first experimental evidence that proximity to predators can increase the intensity of animal social relationships.
"This research is important in our efforts to understand why social bonds and friendships form," said first author Dr Robert Heathcote, of Exeter's Centre for Research in Animal Behaviour.
"The effects of dangerous environments on social bonds are also known in humans, such as between soldiers who form strong and long-lasting bonds during active duty in war zones."
Previous research has shown guppies recognise other individuals and develop long and stable social relationships.
In this study, fish were kept in pools and some were exposed to model predators, while others were not.
Guppies frequently leave and join new shoals, and the researchers measured social ties by seeing how often the same fish swam together.
While all guppies developed stronger social bonds when faced with predators, the effect was strongest among those most at risk - the larger and bolder individuals.
Many animal species gather in large social groups to gain protection from predators, but the scientists found guppies formed smaller groups as they strengthened their social ties.
"We suggest this may reflect a conflict between the benefits of forming larger groups and those of forming stronger relationships," said Dr Safi Darden, a co-author on the study.
"The maintenance of social relationships often requires individual recognition, which can be cognitively demanding when it involves large numbers."
Professor Darren Croft, also a co-author on the study, said: "It is becoming increasingly clear that social relationships, 'friendships', are widespread across vertebrate species.
"Just as in humans where our friendships can predict our life expectancy, non-human animals can also benefit from forming stable social bonds.
"Our new work suggests that living under the threat of predation may have played a key role in the evolution of social relationships, and more work is needed to examine this across species."
The paper, entitled "Fear of predation drives stable and differentiated social relationships in guppies", is published in the journal Scientific Reports. The work was funded by the Natural Environmental Research Council, Leverhulme Trust and the Danish Council for Independent Research.