When light passes through a medium like glass and then emerges back into a vacuum or a less dense medium, it resumes its previous speed due to a phenomenon called refraction.
Refraction is the bending of light as it passes from one medium to another with a different refractive index. The refractive index is a property of a medium that determines how much the speed of light is reduced when it enters that medium compared to its speed in a vacuum. Different materials have different refractive indices.
When light travels through a medium like glass, it interacts with the atoms or molecules of the material. These interactions cause the light to slow down because the electric fields of the light waves induce vibrations in the charged particles of the medium, which takes some time. As a result, the speed of light is reduced within the medium.
However, when the light emerges from the glass or any other medium and enters a less dense medium or a vacuum, the interactions with the atoms or molecules decrease significantly. This decrease in interactions allows the light to resume its original speed, which is the speed of light in a vacuum.
The change in speed of light as it moves between different media is governed by Snell's law of refraction, which relates the angle of incidence and the angle of refraction as well as the refractive indices of the two media. According to Snell's law, the change in speed causes the light rays to bend or change direction at the interface between the two media.
In summary, when light emerges from a medium like glass and returns to a vacuum or a less dense medium, it resumes its previous speed because the interactions with the atoms or molecules of the medium decrease, allowing the light to travel at its original velocity.