What is the pacemaker's primary job?

Pacemaker. A pacemaker is an electronic device which uses a lead as an antenna to sense the heart's electrical activity. It uses the same lead (s) to deliver a small electrical impulse to the heart to make it contract if the heart isn't going as fast as the device was programmed to maintain. Pacemakers both sense heart activity and pace it to produce activity. They maintain heart rate. Other things too....
Prevent bradycardia. Most pacemakers are are placed in order to treat excessively slow heart rate (bradycardia). When the heart rate falls below a certain level, the pacemaker is automatically activated at a rate set by the cardiologist.