If light hits a boundary at an angle greater than the critical angle it will undergo total internal reflection.
When light passes from a more dense medium (e.g. glass) into a less dense medium (e.g. air) it will speed up and bend away from the normal (i.e. it is refracted). If the angle of incidence is greater than the critical angle of the more dense medium then the light will be reflected inside the material instead of being refracted.