Active noise cancelling
Let’s start with a simple onedimensional (or also a plane wave) harmonic wave that has source at origin of coordinates. This is described as \[ w(x,t) = a \sin \left(\omega \left(t  \frac{x}{c}\right)\right) \] where $\omega = 2\pi f$, $a$ is wave amplitude and $c$ is the speed of sound.
The noise cancelling synthesizes a counterwave and emits it at distance
$\Delta x$ from the microphone and with delay $\Delta t$, hence
\[
\newcommand\canc[1]{\overline{#1}}
\begin{align}
\canc w(x,t) &= a \sin \left(\omega \left((t\Delta t)  \frac{x\Delta x}{c}\right) + \varphi\right)\
&= a \sin \left(\omega \left(t  \frac{x}{c}\right) 
\omega \left(\Delta t  \frac{\Delta x}{c}\right) + \varphi\right)
\end{align}
\]
and we introduced parameter $\varphi$ representing phase shift of the
cancelling signal while assuming the amplitude is exactly matched.
Now, we are interested in the resulting superposition of the waves, we use the
goniometric equality
\[
\sin A + \sin B = 2 \sin \frac{A+B}{2} \cos \frac{AB}{2}
\]
to express the compound wave
\[
\begin{multline}
w(x,t) + \canc w(x, t) =
2a \sin \left(\omega \left(t  \frac{x}{c}\right) 
\frac{\omega}{2} \left(\Delta t  \frac{\Delta x}{c}\right)  \frac{\varphi}{2}
\right)\
\cos \left(
\frac{\omega}{2} \left(\Delta t  \frac{\Delta x}{c}\right)  \frac{\varphi}{2}
\right)
\end{multline}
\]
We can see that the sine factor is the original wave just phase shifted^{1} and the cosine factor represents amplitude of the composed wave.
Ideally, we’d like to have $\Delta t = \Delta x / c$ to eliminate both the phase shift and achieve perfect destructive interference ($\varphi = \pi$).
Speed of sound is some 340 m/s and estimate $\Delta x ~ \approx 3.4\,\t{cm}$ so the $\Delta t = 100\,\mu\t{s}$. During this time the ANC system must AD convert input signal, apply phase shift ($\varphi = \pi$ is simple sign reverse) and DA on output. The period corresponds to 10 kHz sampling and since there are devices commonly able of 44 kHz processing, this task should be doable digitally within the real time contraint.
The plot^{2} below illustrates cancellation effect when delay is off by 1 μs (1% error), 10 μs or 100 μs (i.e. no delay).
Note that the 100 μs cancellation causes constructive interference around 5 kHz.
Conclusion
Noise from distant source can be considered a plane wave (our model), the cancelling speaker doesn’t produce a plane wave of matching amplitude (over whole spectrum). The real world is not 1D, so full cancellation happens only in some areas, also depending on the relative direction of the source.
The 1D model estimates the best achievable cancellation under ideal conditions.
Extra: review of Sony WH1000XM3
 what is silence
 hearing own body (breath, heart)
 head tremor
 tinnitus
 active noise cancelling
 surprisingly good for low frequencies (engines, moving vehicles)
 worse for speech
 it adds some (hiss) noise (microphones, amplifiers)
 passive filtering is also quite good
 Bluetooth
 idling may cause audible latency (codec dependent?)
 cannot use mobile app when jack is plugged in

Different frequency will have different phase shifts, which may be audible. ↩

Credits to funtion plot library ↩