You see a rainbow because when light enters the prism it separates the white light based on energy levels this is what we see as the rainbow, the rainbow goes from low energy level to high energy levels
Frequency related to the color of the rainbow shown.
We see light based on the frequency of the waves. Violet has the highest energy and red has the lowest energy. Violet also has the shortest wave length which means red has the longest wavelength