There's two ways it can happen: refraction and interference - I think. I think this is refraction - somewhere the sun is shining through some glass and the light is getting bent. The red waves get bent a little more than the blue ones, so they get split out and we see them separately with all the others in between.
That's different to interference, I think, which like when you look at an oil puddle. Becasue the different wavelengths are a little separated, they cancel each other out in different ways and give that funny swirly rainbow pattern. I can't really remember how that one works - it WAS 27 years ago in high school that I got taught that stuff. But anyway, son/daughter, you can Google it now. Try "interference fringe spectrum".
UPDATE: Aha. Front and rear surfaces of the oil film reflect at slightly different distances. When they're a half a wavelength apart, they interfere. That's right, I remember.
No, I didn't have a kid in the lift to ask me that question - but the wonder of the world - and the beauty of it is everywhere. If I think I have the answer I'll offer it otherwise I'll be happy enough just to say "I don't know - let's have a look".
UPDATE 3/8: not as pretty on a black background, or maybe it is.