Remember that colors really are in the eye of the beholder. The range of wavelengths and the number of visible colors vary from species to species. (And to a smaller degree: even from individual to individual.)
For example, what appears to be bright yellow to the human eye could be:
pure light at a wavelength of ~580nm (e.g. the yellow of the rainbow),
a mix of red at ~440nm and green at ~530nm (e.g. pure yellow on a computer screen),
any mix of the former two options.
Therefore, it was not the trees that evolved to show exactly these colors, it's rather humans that evolved to see these colors in a specific way. To another species, the color of trees in fall might look quite unspectacular.
CosmoTheAstronaut t1_irvk88d wrote
Reply to Is there an evolutionary reason behind deciduous trees’ vibrant fall colours? by Team_Ed
Remember that colors really are in the eye of the beholder. The range of wavelengths and the number of visible colors vary from species to species. (And to a smaller degree: even from individual to individual.)
For example, what appears to be bright yellow to the human eye could be:
Therefore, it was not the trees that evolved to show exactly these colors, it's rather humans that evolved to see these colors in a specific way. To another species, the color of trees in fall might look quite unspectacular.