Why does dispersion occur when white light passes through a prism?