Because the human ear is very sensitive to sudden changes, however, it is necessary for the success of the illusion that the amplitude of the tone in the region of the discontinuity not decrease or increase too abruptly.
[1] While the inner mechanisms of this illusion is not well understood, there is evidence that supports activation of primarily the auditory cortex is present.
[6] There does seem to be limitations to this, however, as the sound that masks the original foreground stimulus needs to have appropriate composition and intensity.
The foreground and background noise must both be fitting to the criteria required for this illusion, and not just one or the other.
If the gap is too long or the occluding sound too short, the illusory effect will wear off.
These brain regions "repair" the lost sound using past experiences and context subconsciously, creating this illusion.