When a beam of light passes from one medium to another the beam bends if the two mediums do not have the same refractive index.
If the angle of incidence is A and the angle of refraction is B, the two are related by `(sin A)/(sin B) = (n2)/(n1)` where n1 is the refractive index of the first medium and n2 is the refractive index of the second.
The optic fiber is made of a material with refractive index 1.5, the refractive index of air is 1. A beam of light undergoes total internal reflection when the angle of incidence is equal to `sin^-1((n2)/(n1))` . For n2 = 1 and n1 = 1.5, `sin^-1(1/1.5) ~~ 41.81` degrees.
If the angle of incidence is equal to 41.81 or greater the beam of light does not leave the optic fiber.