The spots of leopards and cheetahs and the stripes of tigers are among the most eye-catching coat patterns in the animal kingdom. Yet, for as much as we appreciate their beauty, why these big cats evolved their various styles of outerwear has long kept biologists scratching their heads. But now, thanks to the work of researchers from the University of Bristol in the United Kingdom, we have some insight into this mystery, and as Rudyard Kipling predicted, the leopard’s environment has everything to do with how these amazing creatures got their spots.

The report, published in the journal Proceedings of the Royal Society B, revealed that, in general, cats’ coat patterns have evolved to serve as camouflage, enabling them to blend in visually with their environments. Coat patterns also fit with the behaviors cats display within their environments—for example, cats that hang out in trees or that hunt at night are more likely to have complex coat patterns than cats that spend their time in open spaces.

The University of Bristol team focused their investigation on the coat patterns of more than 35 species of felines, including jaguars (Panthera onca), clouded leopards (Neofelis nebulosa), and the black-footed cat (Felis nigripes). The researchers collected photos of each species and then developed a set of coat parameters, such as plain coat versus patterned, pattern complexity, and pattern irregularity. This enabled them to reproduce the coat patterns using mathematical modeling. Their model was based on the reaction-diffusion theory of patterns, which, when applied to biological systems, considers the influence of chemical reactions that take place during embryonic development on pattern formation, including the distribution of color markings in space (e.g., a feline’s coat).

That environment influences coat patterns in cats is not wholly surprising. But when the researchers compared coat patterns, habitats, and behavior of different species using their mathematical model, they were able to tease out subtleties in evolved traits and to demonstrate the tremendous pressure created on pattern development by habitat. This led to intriguing findings such as the parallel relationship between increasing amount of time spent in trees and increasing complexity and irregularity in coat patterns. The researchers also found that coat pattern is not related to social interactions, overturning hypotheses that spots and stripes might somehow serve as social cues or as mechanisms for mate attraction.