It's the Original Electric Motor
With one exception, nerve cells in your body can't "fire" unless there's external stimulation. That exception is the sinoatrial node (SA node), a tiny bundle of highly unique neurons that are self-starters. The SA node fires about once a second, and the electrical charge it produces is the reason your heart pumps, your blood circulates, and, ultimately, why every part of your body is able to function.
When it pumps, the heart constricts and sort of twists, and then relaxes only to constrict again with the next heartbeat. When the heart beats, an electrical signal passes from the top of the heart, near the atria (upper chambers), down through the ventricles (lower chambers), and the chambers contract in that order.
Your SA node sends out the electrical signal that guides the rest of the heart tissue. So when the atria contract, the valves sandwiched between the atria and the ventricles open, and the blood in each atrium flows through its respective valve down into a ventricle.
By this time, the heart's electrical signal has passed from the atria into the ventricles, so while the atria relax, the ventricles contract. This forces blood out of the exit valves and into the body, and by the time the lower chambers and exit valves relax, the upper chambers and entry valves are receiving another electric prompt. This process repeats about once a second.