Answer:
The incoming white light is composed of light of different colors,
Since these different colors have different refractive indices they are refracted at different angles from one another.
The output light is then separated by color creating a color spectrum.
Since n is greater for shorter wavelengths (violet colors) these wavelengths are refracted thru the larger angles.