Consider the earphones that have earbuds in them. They block outside noise by providing a noise reducing barrier.
Headphones that essentially listen to ambient noise and produce an opposite sound wave to blank out the unwanted sound. Fill your bathtub with water. Drop two rocks into the tub one at each end. When the waves collide you will see a spot where the water seems calm because the waves are cancelling each other out. Noise cancelling headphones produce this negative wave by listening in to the outside noise and producing the opposite wave to cancel out the wave just like in the water.