as i understand it this is what happens.
when you do something on your computer, it will then store that info on your hard drive ANYWHERE it fits, now say you have a 7cm space and a 6cm bit of information, it will put the information in the space, but the 1 cm left will be left empty. some times it will try and put the 6cm bit of information into a 3cm space, it will do it but snap it in half and put the other 3 cm bit into another place. It is not THAT stupid, it does know where it put everything (for later retreaval)
Now you would have thought that the logical way to do it is to put the next bit of info after the last bit so, no spaces, no that is "too easy"
So when you defrag, as i understand it, it rearanges everything and "shuffles it about" to remove the odd little spaces, (this saves time by not having to look in an empty space later) but if some info is "broken in two" it may get moved, but not rejoined.
I should point out i used cm as an example to make understanding easier, in reality its not that big at all.
Then again i may have got it all wrong