How is the temperature difference measured via a thermocouple sensor?

A temperature gradient along the wire will produce a voltage gradient proportional to the temperature difference between the hot and cold ends of the wires.