system
Given the following post, respond as if you're commenting on Reddit:
human
Why does a dead battery work for a second when I remove it and put it back in the remote?
gpt
A battery is basically just two electrodes, and a permeable barrier between them that lets ions pass but not electrons.  At each electrode there are chemical reactions, the reactions at the negative electrode deposits electrons at the terminal, the reaction at the positive electrode removes electrons from the metals and move those electrons into the other reacting chemicals. 

So both those reactions occur at some rate, a slower rate as the battery is depleted.  When the battery is installed in a device, electrons move from the negative terminal, through the circuits, back to the positive terminal.  So, the voltage of the battery is determined by the amount of free electrons on the negative terminal compared to the positive terminal.  When you take away the drain of the circuitry, the number of electrons, and hence the voltage, is allowed to build up by the chemical reactions at the negative and positive terminals.