Why outlets spark when unplugging - EMF & Inductors

When a magnetic field  is passed through a coil of wire , elactricity is generated.
Now
When the power is removed from the coil of wire that is producing   a magnetic field,  the field colapses,  as the lines of Flux colapse, they pass through the coils of wire producing more electricity. ..
The generating of electricity is a factor of how fast the magnetic lines of Flux pass through the wire.
A generator only turns so fast. But in an inductor the lines colapse at nearly the speed of light. ..
ie.  Lots of voltage 
I hope this helps....?
That is why an EMP is nasty.