Total internal reflection occurs when light, instead of being refracted at a boundary between media of different densities, the light is totally reflected off the inside surface. The usual case is inside glass, where the light ray bounces off the inside of the glass instead of escaping out. This effect is the basis of fibre optics - used in communication and medicine.
Total internal reflection occurs only when the angle of incidence is above a certain value called the critical angle