This is related to leaf shape and size. This also determines how and where the leaves will end up in the wild. This distributes them across the landscape where they decay and enrich the soil where they cease their travels. Leaves know when to bud out and when to fall off. It has been placed in them to follow the cues of nature.
Many leaves start growth in the spring and turn colors and die in the fall.
Many of these colors were already in the leaf. Shorter, cooler days alerted the tree to remove the green pigment into storage for next year's growth. This leaves the other pigments to reveal themselves as the green fades. Other colors are formed in the fall to add to the show. These masterpieces of engineering are perfectly designed for their function.