Do you know how Data is stored in your computer ?
The operating system stores data in little chunks called blocks on the hard disk. If a file that you save is large and can’t fit in a single block, the operating system divides it into multiple blocks.
These blocks are chosen wherever there is free space on the disk and are not guaranteed to be contiguous, but the OS knows about the various chunks. So whenever you request for the data, the operating system asks the hard drive to visit all the different parts of the disk that the data is stored in and gets them to you. This process is usually extremely fast and for the user it almost feels as if that the data is stored in one long contiguous block.
But, as you use your computer for everyday tasks, bits of data get more fragmented, which means that the small chunks get distributed throughout the disk and so the process of getting them all together, in case of a file request, slows down the whole system.
Disk defragmentation is the process of reorganizing bits of data on the hard disk so as to align them in contiguous blocks and make file access faster.