Setting the axis of a set of Polaroid filters at right angles prevents light from passing. Setting the axis to the horizontal eliminates vertical light waves, leaving only horizontal ones. When the axis of the second filter is vertical, it eliminates the horizontal waves.
Manufacturers make Polaroid filters using long-chain polymers that all align in the same direction. Light moves through these polymer chains like waves along a rope passed through a picket fence. The boards eliminate movement in all but one direction. Placing a second section of fence behind the first one and rotating to a right angle with the first section eliminates motion in both directions.