Sound waves are similar to water waves. They have compressions that correspond to crests and rarefactions that correspond to troughs.
Noise-canceling headphones come in either active or passive varieties. Passive noise-canceling headphones use high-density foam or other sound-absorbing material to prevent sound waves from reaching the listener's ears.
Active noise-canceling headphones add an extra level of noise reduction by actively erasing lower-frequency sound waves. They do this through destructive interference -- creating sound waves that have the same amplitude and frequency as the ambient noise, but are 180 degrees out of phase.
Good noise-canceling headphones provide a noise reduction of about 80 decibels, enough to block jet-engine noise inside an aircraft cabin.