An Automated External Defibrillator (AED) is designed to analyze a victim's heart rhythm, and then deliver a shock if the patient is in a certain kind of rhythm (ventricular fibrillation.) The goal is to DE-fibrillate the person.
When a cardiac arrest victim is in ventricular fibrillation, there is actually a massive amount of electrical activity going on in the heart. The problem is, that it is uncoordinated electrical activity. The heart normally functions in a coordinated electrical way, sending a signal from the top part of the heart to the bottom. Muscle contraction follows from the electrical impulse, again, along a specific pathway from the top to the bottom. In V- fib (ventricular fibrillation), the electrical impulses are firing in every part of the heart in an uncoordinated manner (like a television on static) and so the muscle is just quivering, and no blood can flow out of the "pump" that is the heart (the TV has no picture.)
An AED delivers a very high energy shock that stops ALL of the electrical activity in the heart (like a power surge cutting off the television). Hopefully, when the electrical activity of the heart resumes, it starts from the top again, and progresses to the bottom in the coordinated manner that it has done for the person's whole life. (maybe when the TV comes back on, it will get channel 4!)
So, an AED actually stops the heart. If all goes well, the heart is then able to "restart" itself, the right way. Chances are increased further when CPR is resumed immediately after the shock is delivered.