Why are there colors on a rainbow?
3 answers
Because the various wavelengths of light coming from the sun and refracting toward your eyes through the wet air are bent through different angles.
Here is a more complete description:
https://www.physicsclassroom.com/class/refrn/Lesson-4/Rainbow-Formation
https://www.physicsclassroom.com/class/refrn/Lesson-4/Rainbow-Formation
To add to Damon's great description, each water droplet in the air acts as a tiny prism.