appliance repairman here?

what exactly does a thermocouple do? Does it sense the ignition temperature of the ignitor before switching on the gas? I can see how if that was faulty the gas would never turn on.