With shiny evergreen leaves and bright red berries, holly trees are a naturally festive decoration seen throughout the Christmas season.

They're famously sharp. But not all holly leaves are prickly, even on the same tree. And scientists now think they know how the plants are able to make sharper leaves, seemingly at will. (Watch a video about how Christmas trees are made.)

A new study published in the Botanical Journal of the Linnean Society suggests leaf variations on a single tree are the combined result of animals browsing on them and the trees' swift molecular response to that sort of environmental pressure.

Carlos Herrera of the National Research Council of Spain led the study in southeastern Spain. He and his team investigated the European holly tree, Ilex aquifolium. Hollies, like other plants, can make different types of leaves at the same time. This is called heterophylly. Out of the 40 holly trees they studied, 39 trees displayed different kinds of leaves, both prickly and smooth.

View Images Five holly leaves from the same tree. Photographs by Emmanuel Lattes, Alamy

Some trees looked like they had been browsed upon by wild goats and deer. On those trees, the lower 8 feet (2.5 meters) had more prickly leaves, while higher up the leaves tended to be smooth. Scientists wanted to figure out how the holly trees could make the change in leaf shape so quickly.

All of the leaves on a tree are genetic twins and share exactly the same DNA sequence. By looking in the DNA for traces of a chemical process called methylation, which modifies DNA but doesn't alter the organism's genetic sequence, the team could determine whether leaf variation was a response to environmental or genetic changes. They found a relationship between recent browsing by animals, the growth of prickly leaves, and methylation.

"In holly, what we found is that the DNA of prickly leaves was significantly less methylated than prickless leaves, and from this we inferred that methylation changes are ultimately responsible for leaf shape changes," Herrera said. "The novelty of our study is that we show that these well-known changes in leaf type are associated with differences in DNA methylation patterns, that is, epigenetic changes that do not depend on variation in the sequence of DNA."

"Heterophylly is an obvious feature of a well-known species, and this has been ascribed to browsing. However, until now, no one has been able to come up with a mechanism for how this occurs," said Mike Fay, chief editor of the Botanical Journal of the Linnean Society and head of genetics at the Kew Royal Botanic Gardens. "With this new study, we are now one major step forward towards understanding how."

Epigenetic changes take place independently of variation in the genetic DNA sequence. (Read more about epigenetics in National Geographic magazine's "A Thing or Two About Twins.")