Enamel in teeth is made up of network of calcium and phosphate bundled together into rod-like structures. Staining agents can work their way down the spaces in between the rods. This is what can give teeth their yellowish tint.
Whitening products, from gel to strips, use the same active ingredient: Hydrogen peroxide. It breaks up the chemical bonds of molecules responsible for staining teeth and the result is whiter teeth.