Optical fibers trap light inside their core by repeated total internal reflection at the core-cladding boundary. It is rather like making light "bounce" through a transparent tunnel.