If the computer notices an abnormal heart rhythm, it tells the pulse generator to deliver the appropriate electrical shocks through the wires to the right part of the heart. This helps the heartbeat go back to normal.