The most efficient way to store a file is in a contiguous physical block. However, over time, as a storage device reads and writes data, fewer blocks of free space are available. In some cases, it may be necessary to split a file into multiple areas of a storage device. This is called file fragmentation.
While computers can read fragmented files, it is less efficient than reading a file saved in a single block. When an HDD accesses a fragmented file, the drive head has to jump to multiple areas to read it, which can cause a noticeable slowdown. Fragmentation may also occur on an SSD, and while the effect isn't as significant, it will still take longer for an SSD to read a fragmented file. If your HDD or SSD has a large number of fragmented files, it can significantly affect your computer's performance.
Ideally, an HDD or SSD would have no fragmented files and different types of data would be organized into to different physical areas of the storage device. For example, system files, applications, and documents would all be organized into separate groups. This arrangement would provide the most efficient data access with the shortest seek time, and therefore the fastest performance. A defragmentation utility can defragment individual files, while an optimization utility will actually separate and move different types of files to different areas of the storage device.
Since fragmentation can cause disk performance to decline over time, most modern operating systems include some level of automatic defragmentation. While the OS may not offer as comprehensive defragmentation as a specialized disk utility, it can still help maintain the performance of your storage device.
NOTE: Another type of fragmentation is memory fragmentation, which refers to fragmented data in RAM. When memory is becomes fragmented, more RAM is allocated than what is used, resulting in less available memory.