Fighting Sound With Sound
There are two ways to keep unwanted noise out of your ears. The simple way is to physically block it, the way thick earmuffs do. Active noise-cancelling headphones do something far cleverer. They actually add a carefully crafted sound of their own, one designed to erase the noise rather than cover it. To see how that can possibly work, you have to look at what sound really is.
Waves That Can Cancel
Sound travels as waves of pressure in the air, rising and falling. When two sound waves meet, they add together. If the high part of one wave lines up with the low part of another, the two can cancel, leaving quiet. This effect is called destructive interference. Noise cancellation is built entirely on this idea: produce a wave that is the mirror image of the incoming noise, and where they meet, much of the noise simply disappears.
Listening Before It Cancels
To build that mirror wave, the headphones need to know what the noise sounds like. Tiny microphones built into the earcups constantly listen to the sound around you. A small processor inside analyzes that noise and, in an instant, generates the opposite wave, which the headphone speakers play alongside your music. The result is that a lot of the surrounding drone reaches your ear already cancelled, leaving the music clearer and the world quieter.
What It Handles Well
Noise cancellation is not equally good at everything. It works best on steady, low, continuous sounds, like the constant rumble of an aeroplane cabin, a train, or an air conditioner, because their pattern is predictable enough to mirror. It struggles more with sudden, sharp, unpredictable sounds, such as a voice or a door slamming, which change too quickly to cancel cleanly. That is why these headphones turn a roaring flight into a soft hush, yet a person talking nearby may still come through.
Source
This article was written using information from Wikipedia.