When white light passes through a prism, it is dispersed into its constituent colours because the refractive index of the prism material is slightly different for different wavelengths of light. Longer wavelengths (like red light) are refracted less, meaning they are deviated least from their original path, while shorter wavelengths (like violet light) are refracted more and are deviated most.