There's actually different levels of "deleting".
If you simply delete a file in your operating system (windows, macos, linux,...), it is most of the times simply moved into another folder, the "trashcan", and it will stay there untill you ask to put it back into place, or if you empty the trashcan.
If you "permanently delete" a file, or if you empty it from the trashcan, the operating system will mark the entry of the file as being "deleted". This doesn't mean that the file is gone yet at that moment. It has just been marked as deleted, so that the operating system knows that the part of hard drive that was taken by that file can be reused for other files. And as long as no other files have been written to disk, onto that particular spot, the file you've permanently deleted can still be retrieved by disk-rescue software.
If you "safe delete" a file (not available on all operating systems), the file is marked as deleted on the hard drive, and immediately overwritten by random characters for a set amount of times (99 or so). This makes sure that the file cannot be "undeleted" and read by someone else.