Digital thermostats use a simple device called a thermistor to measure temperature. This is a resistor which allows electrical resistance changes with temperature. The microcontroller in a digital thermostat can measure the resistance and convert that number to an actual temperature reading.
A digital thermostat can do a few things that a regular mechanical thermostat cannot. One of the most useful features of a digital thermostat is programmable settings. In the winter, you can program it to automatically turn up the heat for an hour or two in the morning while you get ready for work, turn down the heat until you get home, turn up the heat in the evening and then turn down the heat while you sleep. This is a great money-saving feature because you can simply turn down the heat when it isn't needed.