right from microsoft
Why do we need Defrag anyway?
When Windows creates a new file on your harddrive, it will search for some empty space, and save the file at that location. When a file is deleted, you will get a hole at that location which is later filled by a new file and so on. The problem is, not all files are of the same size. The solution is to split the files into smaller equally sized parts. This way, when you delete one file and save another one, the parts of the new file will fit into the holes of free space.
This works very well, but, after a while your files will be scattered all over your harddrive. When you try to read a particular file, your computer will have to search your harddrive for all the small parts. This will obviously take a lot of time. (Imagine trying to read a book with the pages in random order.)
When you run Defrag, all the small file-pieces on your hardrive will be reorganized so that all the parts of a particular file are stored sequentially, in one place. This can increase the speed of your system considerably! (Especially if it has been running for a long time without defragging.)
Why does Defrag take so long?
When Defrag is reorganizing your harddrive, it is very important that no other programs are using the harddrive. If some program decides to save a file while you are defragging, the defragmentation process will often be interrupted and start all over again. Because of this, defragmentation may take a lot of time.