Here's why:
* Light travels at different speeds in different mediums. Light travels faster in air than it does in glass.
* The change in speed causes the light to bend. When light enters a denser medium like glass, it slows down. This change in speed causes the light to change direction.
Imagine a car driving on a smooth road and then suddenly hitting a patch of mud. The car will slow down and change direction because of the change in surface. Light behaves similarly when it goes from air to glass.
This bending of light is what allows us to see things through lenses, prisms, and even our own eyes!