When a file has been deleted, the space is free for any use.
The operating system can do what it wants, and typically, it will use the first free sector. Clever systems might look for free areas to match the file size, but in your case the rest of the drive was free, and so started at the beginning.
If it started at cluster 3 or 4, then the chip would become more fragmented.
You are lucky that FAT often saves the details of a deleted file, the MAC erases that altogether, and Ext4 is pretty bad as well.
As a student you should investigate what happens to the high 16 bits of a FAT32 pointer when a file is deleted, and work out how files can be recovered!! (my website has some clues).
↧