You don’t say what file system is on the drive, so here are some general principles…
Any space allocation system (file system space, memory) is a compromise between speed and best results, and what you have seen is a result of speed being the overriding factor.
The File System maintains a Free Sector List. On a clean, empty drive, that FSL is a single entry of one big block. As allocations are made (ie files are created), the big FSL chunk gets smaller and smaller. When deletions are made, the newly available chunks of space are added back as new entries in the FSL. The FSL is usually sorted in some way, but (for purposes of performance) adjacent free entries will not be consolidated.
New files get space from the FSL. The allocation strategy can also be complex or simple (first fit, or best fit, start at the beginning). If a file can fit in a chunk in the FSL, it gets the chunk (and any left over is chopped off and added to the FSL). If the file does not fit into any free chunk, it gets fragmented over several free chunks, and left over bits get added to the FSL. At this stage, the allocation strategy could spend some time sorting and consolidating the FSL to make a single big allocation, but this costs processing time and may be too slow an operation, or too risky to attempt (particularly for a journalled or guaranteed written file system).
It should be obvious that after a few hundred file write and delete cycles, the FSL can get so fragmented that the free fragments are small and any file written ends up fragmented. With memory, there are usually FSL consolidation processes that kick in to ensure that bigger chunks of free memory are available. For a File System, that process is called defragmenting and may be a continuous disk management process, but often is not.
I guess that your drive was used for lots of small files at some stage. The FSL was fragmented, and the allocation strategy used for the file system did not consolidate, and could not find a single contiguous block to fit the file in. It then used a poor “start at the beginning” allocation scheme. Empty the drive, defrag it, and copy the file back.
Si