As a reward for this these trees were allowed to keep their green leaves all year while the others must lose their leaves in the fall. As interesting and fun as this story is to believe, it's probably not why the leaves change colors. The largest factor in determining fall color is a function called photoperiodism , the length of day and night. When the nights start to get longer in autumn, the trees begin their preparation for the dormant winter period. These carotenoids are in the leaves year round, but in the spring and summer months the amount of chlorophyll in the leaves is so great that the green blocks out the orange and yellow pigments.
Some leaves are a little more complex and get a red or purple color.
Old stories say the reason for this is Jack Frost moving through the forests during the fall, breathing his icy breath on the leaves and pinching their stems with his icy fingers to make them the shades of red and purple. The scientists have a different explanation for the red and purple colors. Senescence is the term used to describe the aging and death of a tree or a part of it. As the leaf dies, the anthocyanin pigments are produced. Reduction of chlorophyll also plays a small part in the coloring of the red leaves, as does intensity of light, temperature and the water supply that the tree has.