No, it does not erase it, but the computer marks it as usable space, so that it can be overwritten by fresh data. That is why you can retrieve data unless it has been overwritten, and sometimes even then. To permanently erase it, you need a special 'scrub' program.