The shutter sound comes from the same speaker as the anti-shutter sound. The phone is mixing the tracks together and playing nothing.
It's not like both sounds are played and they neutralize each other as sound waves.
It's just wave addition. -1 + 1, occurring at the same time, is 0.
Again, It's not that simple. Most ANC headphones use a digital feed-forward control system using a variant of the LMS algorithm to provide coefficients to an adaptive FIR filter(s). Generally you also have to apply additional filters to model the loudspeaker / system response. Better systems will use a hybrid analog/digital approach, either way, there is a lot more to it than 'invert the mic signal and add'.
The reason that ANC headphones didn't really exist until recently is that sufficiently high performance yet low power DSPs were needed to perform the necessary computations.
v(t) + -1*v(t) = 0
approach is unworkable because you can't generate the canceling signal (-1 * v(t)) fast enough? By the time you have received it, amplified it, and played it back, it's too late? So you need a predictive approach.