Why do 'dead' batteries work again after exchanging the places of the batteries in an electronic device? My camera, which is powered by two AA batteries in series, would not power on. I removed the batteries, exchanged their locations, and the device worked again - for another 15 minutes or so. 
The temperature of the batteries did not change, and only about few minutes passed before I discovered this.
Is there a physical explanation for this phenomenon?
 A: Sometimes dead batteries will return to life if the are shaken. This only works for batteries that have liquid energy storage chambers. I have never heard of it working with AA batteries before, but I haven't heard of a lot of things. 
A: I've noticed this many times, too.  In many devices, the batteries are in series and two of the terminals are just a short-circuit to connect them to each other.  In these, the total voltage is the sum of the individual voltages, and the order of the batteries should have absolutely no effect on anything.
I can think of 2 possibilities:


*

*The act of removing them and putting them back in is causing the effect.  It might remove power from a microcontroller or other "always-on" part of the circuit and cause it to re-measure the battery voltage when they're re-inserted, for instance.  You could test that this is the cause by removing them completely and then putting them back in the same order, and see if it has the same effect.

*In other devices, the middle terminal is actually used in the circuit, such as a circuit that has ground, +3 V, and −3 V powered by 4 batteries:

In this circuit, it's very unlikely that both sets of batteries (positive supply and negative supply) will be drained at exactly the same rate.  Maybe a power LED is connected between + and ground, for instance, which draws a little more than the ground to − side.  By removing the batteries and replacing them in different places, you could be putting the less-depleted batteries in the more-hungry slots, which would squeeze a little more life out of them.

A: First, your camera is not designed to work with batteries below a certain voltage. When it detects an excessively low battery voltage it turns itself off. That circuit stays in the "off" state until voltage is completely removed from the circuit.
When you operate your camera, the current required by your camera varies according to what you do with it. So the typical current required by your camera is less than the maximum current. Theoretically batteries are supposed to have a voltage which doesn't depend on the current you draw from them, but this is only an approximation. In fact, all batteries have a negative V-I curve; if you increase the current taken from them, their voltage decreases. This effect is like having a resistor in series with the battery. It is called the "internal resistance" or impedance sometimes. Usually it is a very small effect but the dead voltage sensor in your camera can be very sensitive and so small effects can make a big difference. In addition, as a battery runs out of juice, its internal resistance increases [also see] and so the slope of its IV curve increases.

As you use a camera, the current requirement goes up and down. As the batteries run out of power, eventually the maximum current usage will give a voltage that is too low for your battery's voltage detection circuit. At that time your camera will turn itself off.
Your swapping the batteries had no effect on their voltage. (Okay, there might have been a very very slight effect from your hands warming the batteries slightly, but this effect is probably quite small compared to the effect I'm describing here.) Instead, what you did was to reset the dead-battery circuit. After 15 minutes, either you did something that increased the battery current enough to again trigger the dead-battery circuit, or possibly the small current drain caused the battery to become even more dead than it already was.
