The red color of the autumn leaves is caused by anthocyanins, and some species produce this pigment to protect the leaves from the cold season.
Anthocyanins allow the leaves to stay on the tree for a long time so that more valuable nutrients can be taken before the leaves fall.
Some plants make anthocyanins throughout the year to attract birds or drive away insects. In addition, this pigment is also an antioxidant that also helps protect plants against strong sunlight and repairs leaf damage faster.
Of course, there are also many species for ornamental purposes, and artificial breeding makes its leaves grow red.