The great mystery of why zebras have their stripes has been solved, a new study claims.

Scientists say biting flies are to blame. According to experimental work, insects like horseflies and tsetse flies avoid striped surfaces, which may explain why zebras developed their telltale look.

The study, published Tuesday in the online journal Nature Communications, describes how the research team from the University of California, Davis, mapped out the different geographical regions where zebras, horses and asses, and their subspecies, live. They took note of their stripes and their intensity. The scientists then compared the animals’ geographic locations with different variables, including biting fly populations, and found that the stripes were correlated with the number of biting flies in the region.

“I was amazed by our results,” Tim Caro, a UC Davis professor of wildlife biology and the study’s lead author, said in a statement. "Again and again, there was greater striping on areas of the body in those parts of the world where there was more annoyance from biting flies.”

This wasn’t the first time science has tried to explain zebra stripes. Alfred Russel Wallace and Charles Darwin debated the problem 140 years ago. Other hypotheses posed over the years explain the stripes as a form of camouflage, a way to confuse predatory carnivores, a form of heat management, a social function or to prevent an ectoparasite attack like biting flies.

The latest study proved that one of the theories explains why zebras have their stripes. Researchers were able to map the location of the best breeding conditions for tabanids – horseflies and deer flies. Researchers found the stripes were related to the several consecutive months for tabanid reproduction.

According to the research, biting flies prefer to land on dark surfaces since they resemble water and mud where they are known to breed. A combination of white and dark surfaces confuses the flies’ navigational sense, NBC News reports.

“No one knew why zebras have such striking coloration,” Caro said. “But solving evolutionary conundrums increases our knowledge of the natural world and may spark greater commitment to conserving it.”