The mystery of how the zebra got its stripes might have been solved: researchers say the pattern appears to confuse flies, discouraging them from touching down for a quick bite.

The study, published in the journal Plos One, involved horses, zebras, and horses dressed as zebras. The team said the research not only supported previous work suggesting stripes might act as an insect deterrent, but helped unpick why, revealing the patterns only produced an effect when the flies got close.

Dr Martin How, co-author of the research from the University of Bristol, said: “The flies seemed to be behaving relatively naturally around both [zebras and horses], until it comes to landing.

“We saw that these horseflies were coming in quite fast and almost turning away or sometimes even colliding with the zebra, rather than doing a nice, controlled flight.”

Researchers made their discovery by spending more than 16 hours standing in fields and noting how horseflies interacted with nine horses and three zebras – including one somewhat bemusingly called Spot.

While horseflies circled or touched the animals at similar rates, landing was a different matter, with a lower rate seen for zebras than horses.

To check the effect was not caused by a different smell of zebras and horses, for example, the researchers put black, white and zebra-striped coats on seven horses in turn. While there was no difference in the rate at which the flies landed on the horses’ exposed heads, they touched and landed on the zebra coat far less often than either the black or white garment.

Further insights, gathered through video recordings of the zebras and a smaller group of horses, revealed flies failed to slow down steadily when zooming towards zebras,unlike they did for horses, and often simply careered into the animals.

The team said the study showed stripes did not act as a long-range deterrent but had an effect when the flies got up close – possibly because of the flies’ low-resolution vision.

“From distances of greater than two metres or so, a zebra would just look like a grey horse – they won’t be able to see the stripes at all,” said How. He added that the most likely mechanisms for the deterrent effect are either that the “sudden reveal” of the stripes on close approach either surprised the insects and made them veer off, or interfered with their perception of how fast objects were moving past them, affecting their ability to land.

The team said the results supported the idea that stripes might have evolved in response to biting flies.

“Zebra – evolutionarily speaking – have developed in parts of the world where flies carry pretty nasty diseases and so there can be some very big fitness consequences to being bitten by flies. Whereas domestic horses haven’t had the same sort of driving force,” said How.

However he added that the explanation might not be the full story: researchers have previously suggested the stripes could offer camouflage, aid thermoregulation or be involved in some sort of social function. While How said there is some evidence for the latter, he pointed out that lions, for example, don’t seem to be confused by stripes. “Zebra are preferential prey for a lot of predators, so it is not really stopping [them],” he added.

That said, How noted the latest experiment was carried out in Somerset rather than around the biting flies of Africa. Other limitations included that the path of the flies could only be seen in two dimensions from video recordings and that the horse coats were made of different materials.

How said outdoor enthusiasts could take inspiration from zebras, suggesting patterned tops and body paint as useful tools to help them dodge nasty bites.