In an electric water heater, the limit switch is an essential safety feature. If the thermostat fails and the water overheats, the limit switch trips, cutting power to the heating elements and preventing further increase in temperature.