When sunlight enters a raindrop, it is refracted (bent). As the light enters, it also undergoes dispersion, splitting into its constituent colours because different wavelengths of light are refracted at slightly different angles. The dispersed light then reflects off the back inner surface of the raindrop (internal reflection). Finally, the light is refracted again as it exits the raindrop towards the observer. All three processes are essential for the formation of a rainbow.