The leaves use photosynthesis to help with the making of food, which requires chlorophyll which is the stuff that makes the leaves green in the spring and summer.
When the seasons start to change and it gets colder out it is harder for the chlorophyll to make the food that the tree needs for those leaves to stay green. So the tree starts using the food that it has already stored up. And when the tree starts using that food gradually you see the leaves start to change color and those fall colors start showing up. They were there all along just masked by the chlorophyll in the leaves. (Conversation)(Kidzone)