A marker is placed, (it’s all about file systems, allocation tables, inodes etc) – if the marker indicates that the file is ‘deleted’ then that part of the HDD can be written over – they’re not really ‘deleted’ (that’s how data recovery works!)
If you want to permenantly erase your HDD and make it insanely difficult for someone to retrieve previously stored data then check out dban.