Just to clarify, the battery isn't actually replaced. The entire pacemaker is swapped out.
Modern pacemakers don't just "die". When the battery voltage drops to a certain level. The pacemaker will go into an "end of life mode" (battery, not person). It's sort of a last ditch conservation mode until the battery can be replaced. What happens then is the pacemaker will fire to a preset pulse rate. It will no longer take into account what the user's heart is doing. The is reported by some to be a very uncomfortable, miserable feeling.