We think of sharks as solitary creatures. Lurking silently beneath the waves, each single toothy predator operating alone, coming together only temporarily as feasting or mating dictates. We may, however, be totally wrong.

According to new research, sharks could be forming large social groups from which smaller numbers break off to forage, and then return - with some sharks within the group even bonding in pairs that persist for years.

This dynamic could have emerged through the accidental sharing of information; aside from just being really nice, it could help us to understand how such flexible, but long-term societies evolve in the animal world.

"We show that shark communities display temporally stable, complex social structures comparable to seabirds and potentially even some mammals," the researchers wrote in their paper.

"While the importance of social information in colonial birds and mammals is now well established, we show that these concepts likely also apply to some species of shark."

Grey reef sharks (Carcharhinus amblyrhynchos) tend to create a home base. They may venture fairly far afield in search of food, but they're not wanderers - they return home. This is known as central place foraging, and it's been observed in a wide variety of animals, from insects to humans.

But having a nest to return to has an obvious benefit for other animals. They can come home to rest and shelter, to care for their young, to bond with their social groups. Grey reef sharks don't stop moving and don't use shelters. They don't display any parental care over their young. And, it was thought, they don't have social bonds.

This behaviour puzzled a team of marine scientists led by shark biologist Yannis Papastamatiou of Florida International University, so he decided to analyse the movements of grey reef sharks over a long period to see if he could figure out why they kept returning "home".

He and his team had tagged 41 reef sharks, and tracked their movements around the Palmyra Atoll from 2011 to 2014. This is how they learnt that sharks behave like central place foragers.

When they returned to the data, the researchers were looking for something different - whether the sharks' movements could be linked to social dynamics.

First, the researchers put together the data on how the sharks moved around, the time they spent at the home base, and which other sharks they moved around with, using an algorithm to identify statistically significant clusters of movement - separating the sharks out into five community groups.

Then, they produced dynamic social networks, based on the assumption that - after controlling for spatial preferences - sharks hanging out with each other are socially connected. This was done separately for each of the four years of tracking data, which led to the identification of 972 significant social clustering events.

Changes in the sizes of each community group were also tracked, as well as cross-movement between the areas delineated for each community.

Finally, the team ran simulations of groups of individual sharks - rather than community groups - to try to figure out the conditions that led to the evolution of more social behaviour.

The observations revealed that the sharks' behaviour seems consistent with what is known as a "fission-fusion society". This is a social group that consists of a changing core, as smaller groups of members split off to forage, and return to rest. For the sharks, this fission-fusion follows a daily pattern - they'll head out at night to forage, and return during the day.

"We show that sharks also form social communities with associations assorted by patterns of space use, with social structure persisting for multiple years," they wrote in their paper.

"Although some individuals moved between the communities defined by the movement networks, their associations with adjacent community members were weak or random. Hence social structure was not purely due to individuals never encountering those from adjacent communities."

Notably, some pairs of sharks continued to associate with each other for the entire four-year span of the research. The team stopped collecting data after 2014, but they believe these associations could continue for much longer.

So, since the sharks aren't raising their young or sheltering, why are they hanging out together? This is where the simulations could have an answer. They showed that sharks that didn't work with other sharks had less success foraging - suggesting that, when the sharks pool their information, they can have more success finding food.

There is, however, a limit - if a community grows too large, competition for food will outweigh the benefits of information sharing.

"For sharks using social information (local enhancement), central place foraging, with multiple individuals using the same central place, provides a significant advantage over random wandering within a home range. These advantages persist under scenarios of both more and less predictable prey patches," the researchers wrote.

It's fascinating reading, and not just because of what it means for our understanding of sharks.

The reasons for these social communities among other animals are fairly well understood. The work of Papastamatiou and his team shows that there could be other, hidden drivers evolving social behaviours in animals we might least expect.

The research has been published in Proceedings of the Royal Society B: Biological Sciences.