Windows comes with its own disk defragmenter, which was built using technology licensed from Diskeeper (formerly Executive Software), makers of the Diskeeper defragmenter. However even Microsoft admits the utility is quite limited.
First, the Microsoft Disk Defragmenter is slow. It doesn't do a particularly good job of defragmenting the disk. What's worse, from an administrator's point of view, is that it is labor-intensive. The built-in defragmenter can only defragment one local volume at a time, and it cannot defragment one volume while scanning another. Most critically, it cannot be scheduled, meaning it must be run manually each time a disk is to be defragmented.
While the built-in defragmenter is better than nothing, it isn't nearly as good as most of the third-party products on the market. Most of those products offer improved performance, faster defragmenting times, and much better management.
Manageability is important. Defragmentation needs to be done regularly, but you don't want to think about it. Ideally, it should be done invisibly. From this standpoint, the biggest lack in the Windows defrag utility is that it can't be run automatically. This, by itself, is enough reason to invest in a third-party defragmenter.
If you are managing a Windows system with multiple volumes to defragment, it's especially important that you be able to intelligently schedule and otherwise manage defragmentation chores. By its nature, defragmentation takes a good deal of time, and it is a job ideally suited to being done lights-off – when no one is around and the load on the system is minimal.
While the intelligence and the features may be quite a bit different in various defragmenters, the underlying mechanism is the same in almost all of them. They all use the Windows API to actually move the clusters around.