Here's why:
* Frequency is a property of the source: The frequency of light is determined by the energy level transitions of the atoms or molecules that emit the light. When light travels from one medium to another, the source of the light doesn't change. Therefore, the frequency of the light remains constant.
* Wavelength is affected by the medium: The speed of light changes when it travels through different media. This change in speed directly affects the wavelength, which is the distance between two successive crests or troughs of the wave. Since the frequency (and therefore the energy) must remain constant, the wavelength adjusts to compensate for the change in speed.
Think of it this way:
Imagine a marching band playing a song. The musicians (the source) determine the tempo (frequency) of the song. When the band marches into a different environment (like a tunnel), their marching speed might change, but the tempo of the music (frequency) remains the same. The change in speed affects the distance between each musician (wavelength).
In conclusion:
* The frequency of light remains constant when it passes from one medium to another because it's a property of the source.
* The wavelength of light changes to compensate for the change in speed caused by the different medium.
Let me know if you have any further questions!