A green leaf is green because chlorophyll hides everything else. In autumn the tree takes that chlorophyll apart and salvages the nitrogen. Carotenoids, which were there all summer, show through as yellow and orange. In many species the red is different. The tree makes new anthocyanins while the leaf is dying.
Marco Archetti and colleagues gathered the arguments in 2009. The chemistry is agreed. The reason for the red is not. It may shade a senescing leaf against too much light. It may warn insects, or say something about the tree. A useful field note is the date a given tree turns, and whether it turns yellow or red. The why can stay marked as open.