The cardiac electrical signal controls the heartbeat in two ways. First, since each impulse leads to one heartbeat, the number of electrical impulses determines the heart rate. And second, as the electrical signal "spreads" across the heart, it triggers the heart muscle to contract in the correct sequence, thus coordinating each heartbeat and assuring that the heart works as efficiently as possible.
The heart's electrical signal is produced by a tiny structure known as the sinus node, which is located in the upper portion of the right atrium. (You can learn about the heart's chambers and valves here.) From the sinus node, the electrical signal spreads across the right atrium and the left atrium, causing both atria to contract, and to push their load of blood into the right and left ventricles. The electrical signal then passes through the AV node to the ventricles, where it causes the ventricles to contract in turn.
Click on each link below for more detailed steps on the heart's electrical signal and how it works.