Most people (me included, prior to my recent training) have the misconception that somebody's heart stops beating and you just zap them to get it started again. It's not that simple.
The heart has its own electrical system. This system is what tells the muscles of the heart when to contract. There are different kinds of cardiac arrest. Most medical-related (as opposed to trauma-related) heart attacks involve a problem with the organization of the electrical energy. Among those types of disturbances, v-fib and v-tach are the most common. (IIRC, v-fib accounts for 50% or more of heart attacks.) The AED has been designed to deal with these 2 types of rhythms, because a simple shock is often effective in correcting them. (The effectiveness will depend on how much damage has already been done to cardiac muscles.) Fixing other types of rhtyhms, such as PEA (Pulseless Electrical Activity), a-fib, and asystole (complete lack of electrical activity), require drugs that only paramedics (a step above EMTs) and doctors can provide. Without the drugs, it doesn't do any good to shock someone.
Other types of heart failure, such as those caused by trauma, CHF (Congestive Heart Failure) or cardiac tamponade (the heart's non-flexible protective sac becomes filled with fluid), cannot be helped by shocking, whether with AEDs or drugs and advanced cardiac equipment. In the case of trauma, the heart stoppage is likely due to decreased blood volume, actual damage to the heart (puncturing a chamber or coronary arteries), hypoxia (deficiency of oxygen in the bloodstream) or neurological damage that impinges circulation. With trauma, CHF, or cardiac tamponade (and probably some other conditions I'm forgetting right now), surgery is the only way to save the patient.
I am not a doctor, however, so my explanation may not be entirely accurate. This was what I was taught, anyway.
---
"And Wirthling isn't worth the paper he isn't printed on."