When you delete a file in Moodle, it removes the reference to the file content from the database.
Once all references to a particular piece of content are removed, the file itself is transferred into the "trashdir".
If, after a bit of time (I think it's a couple of days, but I don't know for certain), the file has not been reclaimed from the "trashdir", then it is automatically deleted by a scheduled task.
Off the top of my head, I believe the files in "trashdir" can probably be safely deleted (it's a bit like the recycle bin in Windows - there as a last-chance to recover files, but won't break anything if you clear it early).
Once all references to a particular piece of content are removed, the file itself is transferred into the "trashdir".
If, after a bit of time (I think it's a couple of days, but I don't know for certain), the file has not been reclaimed from the "trashdir", then it is automatically deleted by a scheduled task.
Off the top of my head, I believe the files in "trashdir" can probably be safely deleted (it's a bit like the recycle bin in Windows - there as a last-chance to recover files, but won't break anything if you clear it early).