When light passes through glass, the photons in the light interact with the electrons in the glass. However, photons in visible light don't have enough energy in them to change the state of electrons in glass, so the light just passes through the glass.
The electrons in glass are arranged on different levels and can change from level to level, but such a change requires energy. Photons carry energy from visible light as they encounter glass, but this energy is not enough to move the electrons in the glass to a higher level. As a result, the photons do not interact with the electrons in the glass at all and simply pass through. This process is known as transmission, and it gives glass its transparent appearance.
One of the reasons why visible light will pass through glass but not through other materials is because the molecules in glass require more energy than average to push electrons from one level to another. Photons in visible light simply do not have enough energy.
Only photons of light with shorter wavelengths, such as those that make up ultraviolet light, have the ability to change the electrons in glass. This is why ultraviolet light is unable to pass through glass.