It is related to the sun angle, but more accurately something called photo period. Which is the minutes of daylight in a calendar day.
As the minutes of daylight grow less in late summer and early Autumn, that triggers trees to start shutting down their photosynthesis. The chlorophyll that causes the leaves to look green departs the leaves and the other colors present, but overpowered by the green, start to appear.
Things like climate also play a bit of a role, that is the reason why your leaves typically change sooner there to the south of us here in the northern UP, as we are typically a bit milder in early autumn due to the influence of the big lake.
Also trees that are under stress will typically shut down photosynthesis sooner and change colors sooner too, but many times they just turn brown, rather than the yellows, oranges and reds.
-John