Fish, famously, have no need for bicycles, but schools of fish swim as though they were cyclists. Just like a Tour de France peloton, fish at the back of a school use the slipstream created by the stronger fish out in front to swim with less effort.

Fish swim in schools partly to evade predators and partly to improve their chances foraging for food. Until now, it was thought that these groups were egalitarian structures in which all members benefited equally in food terms, regardless of their position.

But a study published on Wednesday in Proceedings of the Royal Society B shows that the position of a fish in the school depends on how physically fit it is. The fittest swim at the front, where they get the pick of the best food.

The less impressive individuals swim towards the back of the school, but what they lose in quality food they make up for by swimming in the slipstream created by the fish in front of them. The slipstream reduces the drag on the fish at the back, allowing them to swim as fast as all the other fish without expending as much energy. The principle is the same as a group of cyclists who huddle close together during a race.

"Animals moving in coordinated groups, such as birds flying in formation or humans riding bicycles in a peloton, are often found to have reduced energetic costs of locomotion owing to various mechanisms allowing individuals to exploit areas of reduced drag created by more forward individuals," wrote the researchers.

In the latest experiment, researchers filmed schools of eight juvenile golden grey mullet in a swim tunnel, watching how individuals aligned themselves. They estimated the metabolic rate of the fish by measuring how fast the oxygen levels in the water were declining as the animals breathed and worked out the effort each fish was making by counting the number of beats it made with its tail.

Dr Shaun Killen, a biologist at the University of Glasgow, who led the work, found that trailing fish required fewer tail beats to swim at the same speed as individuals at the front of schools.

"Fish with higher rates of tail movement would have been working harder to propel themselves forward and therefore spending more energy," he said. "An analogy would be human runners: those taking the most steps each minute are those having to spend the most energy."

The researchers estimated that when the school was swimming at 30 centimetres per second, trailing fish were having to work 12% less hard compared with the fish they were following.

"One of the most interesting things that these results hint at is that there may be differences in energy demand or performance capacity between schools in the wild. It wouldn't be smart for a fish to join a school with others that are much slower or faster than it is," said Killen.

"Again, this is a bit similar to human runners. If a group of friends are going for a run it makes the most sense if they are all at a similar performance level: a slower person might find it difficult to keep up, while a person who is much faster would be limited by running with a slower group."