noise cancellation of non-repetitive noise
Since I cannot comment, here comes a short answer.

As far as I know, there are microphones outside the earphone. The microphones record the outside noise and generate sounds with 180 phase shift to cancel the noises. The noises are canceled actively.