When you delete files nowadays, you aren't really erasing the sector and replacing it with a new one. You're just erasing the table of contents entry for that sector, so that your computer thinks it's empty and can "write over" that sector later on down the road.
All the program does is ignore the table of contents and searches the drive itself for the true data on it. Most of the time, even after a format, the data is still actually on the drive itself and software such as ERP can read that drive (rather than reading the Table of Contents like Operating Systems do) and "recover" the data. It then writes a new "Table of Contents" so you can see the data in your operating system and all is happy.
That's why a lot of people recommend low level formatting to truely destroy the data on the drive itself, rather than just erasing the table of contents; but in reality, even a low level format doesn't get rid of all of your data. It's still recoverable, as well.