The wavelength and frequency of these deviated colors are different, they deviate differently at different angles due to the velocity difference of the prism.
The greater the wavelength the heavier the wave. The heavier the wave the more energy needed to move the wave in a different direction. As a result, the greater the wavelength, less refraction.
So, we can say that refraction is inversely proportional to wavelength
Therefore, the color red deviates the least since it has a maximum wavelength and the color violet deviates the most since it has the least wavelength.
Each beam of light has its own particular wavelength and is slowed differently by the glass.
Violet light has a shorter wavelength; hence, it is slowed more than the longer wavelengths of red light. Consequently, violet light is bent the most while red light is bent the least.