Rainbows are formed by dispersion, refraction, and internal reflection of sunlight within water droplets. White light disperses into colors, reflects off the back of the droplet, and refracts again as it exits. This requires multiple optical processes working together.