Why do leaves change color?
Trees stop making green chlorophyll for winter, unmasking pigments that were there all along.
Green is just the loudest pigment
A summer leaf is packed with chlorophyll, the pigment that captures sunlight to make sugar. It is so abundant that its green drowns out every other color in the leaf.
The yellows and oranges, carotenoids, sit in the leaf the whole season. You just can't see them until the green steps aside.
Shorter days pull the plug
As nights lengthen and cool, the tree senses winter coming and begins to shut down its leaves. It grows a corky barrier, the abscission layer, where each leaf meets the twig.
Where the reds come from
Reds and purples are different, many trees actively manufacture anthocyanins in autumn, from sugars trapped in the leaf as the abscission layer seals it off. Bright, cool days favor the deepest reds.
Once the barrier is complete, the leaf's last thread is cut and it falls, leaving the tree sealed and dormant until spring.