Much of what I wrote about purple pigments in fall foliage applies here as well, particularly since the purple and red colors on plants are both produced by anthocyanins (anthocyanins take on a purplish hue in the presence of more alkaline sap and are redder at lower pHs). In addition to painting a plant red or purple, these pigments also absorb high energy light in the UV end of the spectrum (source), providing protection from harsh UV radiation. Not surprisingly then, anthocyanins in leaves and on stems are produced in response to sun exposure. This is why a raspberry or blackberry cane is red on the top and green on the bottom (see image below). Bring a raspberry into the shade and it ceases to produce anthocyanins and the stem soon reverts to green.
We see this in how many species, like red maples, change colors in the fall. Initially, the upper part of the canopy begins to take on a brilliant red, while the lower, shaded part of the crown stays green (more on how leaves change colors). As the upper leaves fall are shed or ripped off by the wind (and the sun’s position in the sky at noon draws closer to the horizon), the lower leaves are exposed to more sunlight and begin to produce anthocyanins. The following series shows the changes in the canopy of a silver x red maple hybrid from September 29 – November 6, 2018. Since anthocyanins cost energy and nutrients to fabricate, producing pigments in the absence of sun is a waste of resources. By postponing producing the pigments in lower leaves, the tree can be flexible and responsive to weather conditions over the 2 month period where leaves are being deconstructed and ultimately shed.
The same energy cost-benefit analysis happens on a forest wide scale. Canopy trees (e.g. sugar maple) are more likely to have reds in their foliage (again, the anthocyanins help protect a leaf from UV radiation while it is recouping energy and nutrients), while understory trees (e.g. hophornbeam) are more likely to turn yellow in the fall. The same pattern repeats across seasons. When fall passes under an overcast sky, forests forego anthocyanin production and fall colors are more muted.