There are plenty of things that can stop your heart from beating, besides lack of electrical coordination within the heart.
For example, lack of oxygen, hypothermia, electrolyte disturbance in the blood.
There are also things that can stop the heart doing any useful work even if it tries to beat.
Eg. massive blood clot, air in the chest, blood/fluid filling the cavity surrounding the heart.
Pacemakers will generally keep going after death. There are many different types of pacemaker - some just generate beats, some monitor one part of the heart and stimulate another, so that the parts of the heart beat in time. The more complex ones will enter a 'safe mode' if they can't detect any beats, where they try to generate beats at a fixed 70-80 per minute.
All, however, need to be removed before cremation, otherwise the battery contained within them explodes and damages the crematorium oven.