Why noise canceling headphones do not attenuate the signal itself?
The microphone will record the noise on the outside and the speaker sits on the inside with a bit of passive sound shielding in between. Outside noise will reach the microphone unattenuated, but the actual signal will be attenuated by the passive shielding. The noise that reaches the speakers attenuated by the passive sound shielding and the circuit of the active noise canceling will simulate the effect of the passive shielding to generate the right amount of anti-noise to add to the actual signal for playback on the speaker. The circuit can also simulate how much of the actual signal reaches the microphone and compensate for that or it can just ignore that issue because this effect would only cause a small attenuation of actual signal. 

Example:
Lets say our passive shielding reduces sound levels of signals traveling through it by 75%, so 25% reaches the other side. Actual signal on the inside without noise canceling would be 1.0, noise on the outside would be 1.0 as well. Without noise canceling noise level on the inside would 0.25 and actual signal on the outside would 0.25. So the microphone would record 1.0 noise + 0.25 noise, now when we turn on active noise canceling, as a first order model, the circuit would simulate the attenuation of the shielding and subtract 0.25 noise and 0.0625 actual signal. If the attenuation is simulated perfectly, on the inside we would get 0.9375 actual signal and no noise. SNR is significantly improved. Of course this is just a first order model, the attenuation provided by the passive shielding does not have a flat frequency response and the microphone has also some electrical noise, that will be added to the speaker signal. If the simulation of the passive attenuate is not perfect, we will also add extra noise. We also need to adjust for the frequency response and gain of microphone and speaker. Small errors can easily cause us to add more noise to the signal or subtract to much from it.