An implanted pacemaker monitors heart rhythm and delivers precise electrical pulses to the heart muscle via a lead wire — when the natural SA node fails, the device takes over, timing ventricular contractions and restoring a normal heartbeat.