When white light passes through a prism, it splits into its constituent colors (spectrum - VIBGYOR) due to the dispersion of light. The deviation of each color depends on its wavelength and the refractive index of the prism material for that wavelength. Shorter wavelengths (like violet) are refracted more than longer wavelengths (like red). Among the colors in the spectrum, violet has the shortest wavelength and thus deviates the most, while red has the longest wavelength and deviates the least.