When a ray of light strikes an interface formed by two materials with a different refractive index, part of the ray of light is refracted and passes on from one of the materials into the other, and the remaining is reflected back into the material it originated from.
It is observed that as the angle of incidence, or the angle that the incoming ray forms with the normal, is increased a larger percentage of the ray is reflected back.
Starting at a particular angle of incidence and for angles greater than that there is total total internal reflection with none of the incident ray getting refracted into the other material.
The angle at which total internal reflection starts is given by
A = arc sin (M1 / M2), where M1 is the refractive index of the material with the smaller refractive index and M2 is the same of the material with the larger refractive index.
The fact that (M1 / M2) has to be less than 1 also explains why total internal reflection can only occur when a ray of light is moving from a material with a higher refractive index into one with a lower refractive index and not vice versa.