Interesting, so I guess there is some capacitors that give it enough juice to do this?
Capacitors give the drive the initial supply for the first few milliseconds after the power is removed, but the main source of power to allow the drive to conduct it's retract and shutdown procedures is generated from the still spinning platters. When the drive begins it's emergency power off procedures, it uses the spinning array of platters (now a sort of flywheel) as a generator.
Depending on the drive (number of platters, mass of platters, rpm), the drive could be internally powered for a number of seconds. The retract procedure is still initiated immediately, but the processor could execute code for a short amount of time after power-loss.
In enterprise (and some consumer) SSDs, you often see large banks of capacitors, as the SSD doesn't have a flywheel to keep it alive while it preserves any data that may be in it's cache when power is lost. A good example of this is this Kingston enterprise SSD.
In this SSD, all the black components with the white stripe and the (+) sign are large capacitors. You can even see that the drive was initially designed with more capacitance than the production design, shown by all the empty solder pads to the right of the row of capacitors.