defragging just makes sure each file on the HDD is 'in one place'. think of a file as a chapter in a book. this chapter occupies more than one page. A defragged drive has all the pages for the chapter one after the other, in the right order, so that the first page is first, the second page second and so on.
An optomised drive sorts the order the files are on the disk, as well as making sure that they are all int one place. so that chaper one is first, chapter two second and so on.
This means that files read often are at the front, where they are quick to get to, files that are hardly ever used are at the end, where it takes a long time to get to. Files that are modified lots (Ie made bigger/smaller) and folders which change a lot (such as temp and temporary internet-stuff) are next to the unused space, so that the extra space they need when they get bigger is near them, and the free space left when they are made smaller is next to the rest of the free space.
If you want to be pedantic, defragmenting means making files contiguous, whereas optimising also sorts the files to a position where they can be accessed more quickly. In the old days of PC Tools, one could choose from various sort orders for the files on the drive.
I suspect that all defrag tools also optimise the drive, perhaps some do so better than others.