Suppose you want to shine a flashlight beam down a long, straight hallway. Just point the beam straight down the hallway -- light travels in straight lines, so it is no problem. What if the hallway has a bend in it? You could place a mirror at the bend to reflect the light beam around the corner. What if the hallway is very winding with multiple bends? You might line the walls with mirrors and angle the beam so that it bounces from side-to-side all along the hallway. This is exactly what happens in an optical fiber.
The light in a fiber-optic cable travels through the core (hallway) by constantly bouncing from the cladding (mirror-lined walls), a principle called total internal reflection. Because the cladding does not absorb any light from the core, the light wave can travel great distances.
However, some of the light signal degrades within the fiber, mostly due to impurities in the glass. The extent that the signal degrades depends on the purity of the glass and the wavelength of the transmitted light (for example, 850 nm = 60 to 75 percent/km; 1,300 nm = 50 to 60 percent/km; 1,550 nm is greater than 50 percent/km). Some premium optical fibers show much less signal degradation -- less than 10 percent/km at 1,550 nm.