Most modern cars have computerized sensors. If the coolant level subsides or the temperature rises above average, the engine turns off to prevent damages.