which best explains why rainbows only appear when there is rain and sun

Rainbows occur when sunlight interacts with raindrops in the atmosphere. When there is rain, there are sufficient water droplets in the air to refract and disperse sunlight. The sunlight is composed of different colors, each with a different wavelength. As the sunlight passes through the raindrops, it undergoes refraction, which causes it to bend and separate into its different colors. This bending and separation of white light into its component colors is known as dispersion. The dispersed light then reflects internally within the raindrop and exits at different angles, forming a circle or arc of colors in the sky, which we perceive as a rainbow.