Just and FYI Electric water heaters with two heating elements also have two thermostats. The basic operation is when the water in the whole tank is cold only the upper element is heating the upper half of the water. Once the upper part of the tank reaches the set temperature it switches off the upper element, and provides power to the lower thermostat and heating element. Once the lower reaches temperature, the unit powers off.
When you draw hot water cold water is being forced to the bottom of the tank by a dip tube inside the heater. This way the upper portion of the tank stays hot. As the cold water enters the lower thermostat turns on the lower element in effort to heat the incoming water, if you are using the water faster then the lower element can heat the upper thermostat will switch on disconnecting the lower half and turning on the upper element.