What this does is run the Trim command on the drive (if it supports it). It does not actually defrag the drive, as is the case with a traditional rotating drive. It is probably a good idea to execute Trim to wipe blocks which are no longer in use.
The Windows Assessment Tool (winsat) is what initially determines whether or not the drive is an SSD and switches the behavior of Disk Optimizer. Under Windows 8, winsat runs under the Microsoft\Windows\Maintenance schedule in the Task Scheduler. This is the same tool (winsat) that would disable defragmentation of SSDs on Windows 7.
Just to re-iterate the point and drive it home: Do not think of Disk Optimizer under Windows 8 strictly as Defrag; it is now a general purpose tool that performs the appropriate disk optimization task based on the type of disk which is attached. The identification of disk type is based on winsat.
Official response to a similar question at answers.microsoft.com
Kiran Bangalore [MSFT] -
Hello, In Windows 7 - we turned off defrag for SSDs as you mention in
your entry; but in Windows 8, we have changed the defrag tool to do a
general optimization tool that handles different kinds of storage, and
in the case of SSD's it will send 'trim' hints for the entire volume;
SSDs are storage devices made of flash memory; flash memory unlike
hard disks are block erasable devices - they can be written to at a
byte level but need to erased at a block level; Trim is a storage
level hint that was introduced in the Windows 7 days to indicate that
Windows is not using certain regions of the storage device; NTFS will
send these trim hints when files are deleted or moved from those
regions; SSDs consume these hints to perform a cleanup in the
background called as 'reclaim' that helps them get ready for next
writes. The SSD may choose to perform the optimization immediately,
store the information for later optimization or throw away the hint
completely and not use it for optimization since it does not have time
to perform this optimization immediately.
In Windows 8, when the Storage Optimizer (the new defrag tool) detects
that the volume is mounted on an SSD - it sends a complete set of trim
hints for the entire volume again - this is done at idle time and
helps to allow for SSDs that were unable to cleanup earlier - a chance
to react to these hints and cleanup and optimizer for the best
performance. We do not do a traditional defrag (moving files to
optimizer there location for space and performance) on SSDs.
Thank you for your question and I hope this clarifies the need to run
the Storage Optimizer on a regular basis.