It happened to me quite often (most recently with my wireless keyboard) that a battery stopped to work and then, if I unplug it and then plug it back in it works again, not just for a couple of minutes but even for a day or two, then you can repeat the process but this time it will last less and so on until it finally dies. The same trick works for my tv control. I can't really understand why, can somebody help?
For low current applications that are sensitive to voltage, like modern electronics, the resistance of the contacts can be significant.
So when you reinsert the batteries you clean off any dirt, moisture or corrosion on the contacts, the resistance drops. So when a current flows the voltage drop accross the contacts is reduced and more of the battery voltage is available to the product.
Remember that the multiple (2or3 AA/AAA) batteries are in series, so there are two contact for each battery and so 4 or 6 contact resistances ( of perhaps 0.1 or 0.2ohms) in series. If your electronics needs 3V or 4.5V and takes 50-100mA then you could lose 0.5V !