Where does the energy of noise cancellation go?

The speaker mimics a black body radiator/absorber. If the speaker were 100% efficient and the impedance between the diaphragm and air perfectly matched, then no power need be sent to the speaker and all the sound power would return to the circuit driving the speakers, where its up to the design of the circuit what to do with it (for example, some class D drivers would return the power to the supply, while typically linear circuits would waste the power in a resistor). However, not only are speakers intrinsically inefficient, the diaphragm is horribly matched to the air. So to make the speaker behave as if its a perfect absorber, power must be sent to the speaker, where most is wasted as heat in the coils and magnet. The vast majority of original air power that was to be cancelled is also wasted as heat in the speaker, but a tiny fraction makes its way back to the driving circuit, and then its up to the circuit. But because the efficiency is far below 50%, far more power is spent than regained.