When light rays travel from a more optically dense medium to a less optically dense medium, this phenomenon occurs.
The refracted light ray bends away from the normal as it passes from a medium with a higher refractive index to one with a lower refractive index. The incident ray of light is refracted in such a way that it passes along the surface of the water at a specific angle of incidence.
This angle of incidence is known as the critical angle. The angle of refraction here is 90 degrees.
When the incident ray's angle of incidence exceeds the critical angle, it is reflected back into the medium.