The general description for photography holds for optics as well (as in scientific optics), however a more rigorous discussion is necessary to explain exactly WHY some light is blocked and other light is not.

All electromagnetic radiation (light) can be thought of as consisting of waves. A wave has basically two dimensions (x,y) to wiggle back and forth in if the wave propagates along the third (z).

A polarizer is made of long chains of polymers all oriented in the same direction (think of a bunch of long skinny molecules lying side by side embedded in glass and you have a polarizer.) If light is polarized along the long direction of the molecules, the light is absorbed by the molecules and turned into heat or re-emitted in some random direction. If the light is polarized perpendicular to molecules (along the short direction), the light passes through undisturbed.