Deleting Pixels to reveal background / transparency

This has been bugging me for a little, and some of the examples I have tried to find throw me in loops and they have been wrong.

If you look at this game - http://www.kongregate.com/games/kChamp/shellshock-live

Or if you have ever played “Scorched Earth” you will see that when some part of the terrain is destroyed, it punches out the pixels perfectly when a shot is fired into the ground, to reveal the picture behind the main picture with the terrain. How is this done? I have literally tried everything I know and can’t seem to get it down.

All help is greatly appreciated as always, thanks! :flower: