Why do rainbows appear?

Sunlight splits into colors when it bends through raindrops like tiny prisms.