Flash memory works similar to a hard drive in a sense, deleting a file just alters the File Allocation Table to represent that the sectors holding the deleted data are now useable. When in reality, there is data still stored there. It is then overwritten by data at a later time.
I am sure it is not that simple and there is a more long winded explanation for it.
I have come across some of my SD cards that are non-useable, but I know had data on them. I can then use recovery software to read the memory card and read the data, even if it was deleted previously.