When light passes from one medium to another (e.g., from air to glass), its speed changes because the refractive index of the medium is different. The frequency of light, which is determined by the source of the light, remains constant. Since the speed changes and the frequency remains the same, the wavelength must also change according to the relation: speed = frequency × wavelength.