Dear student, Dispersion of light occurs in prism because light rays deviate while coming out of a prism by an angle. This is called the angle of deviation. Now angle of deviation depends upon the refractive index of the medium of which the prism is composed. Now since different colors in the white light have got different refractive index. thus each color deviates by different angle from the other. Thus, these constituent colors separate out. Regards