When white light passes through a prism, it splits into its component colors because each color bends by a different amount. This separation is called dispersion. The colours are typically ordered as red, orange, yellow, green, blue, indigo, and violet, forming the acronym ROYGBIV.
Different colours of light are slowed down by different amounts. Red light is slowed down the least, so it is refracted the least. Yellow light is refracted more than red, and so on. Violet light is refracted the most, so it travels the slowest in glass.