It does not really erase it, it just tells your computer that it can write over the data as needed. The only way to complete erase the HD is to write zeros to the whole drive. But do not do it anyways it is still a pain in the ass to get your data back.
if it has your Operating System, it will do nothing
if it has any data, with none of it open at the time, it will erase the index at the beginning of the drive which tells the computer where the files are.
as far as a computer knows, if a file is not in the index, it doesn't exist