How does a defibrillator restart a stopped heart?

By resetting it. A defibrillator restart a heart in an abnormal rhythm, the defibrillator sends an electrical shock to clear the abnormal rhythm, with the hope that the normal heart rhythm will restart. If there is no electrical activity- flat line, or asytole. There is no role for a defibrillator.
It doesn't. Defibrillators can reprogram an abnormal rhythm such as ventricular tachycardia or ventricular fibrillation back to normal in some cases. It cannot start electrical activity that has ceased, so if electrical activity isn't there (asystole) defibrillation is of no benefit.
NO CONTRACTION. Fibrilating heart is truly trembling muscle units which are not contracting in synchrony to make an efffective stroke volume of the whole chamber or ventricle, each muscle unit is independent thus no leader they are erratic, shock makes all the muscle units discharge and the pace maker cell unit usualy charges up first and sparks the muscles to contract in rhythm to causea effective stroke volume.