Temperature sensing has been a standard feature of CPU's and many other components for a long time now - as CoreStyler says, it is a necessary form of protection for the chips.
This is handled at the motherboard/BIOS level - at boot-up time, long before Windows starts up, all of the hardware is scanned so that the MoBo knows what features each component has - the BIOS then sets everything up to use the correct settings for all of the parts. For example, if you upgrade the main CPU chip on your motherboard, it will be automatically detected, and all of the important voltage and timing settings on the MoBo will be adjusted automatically. Windows then has access to this data by requesting it from the BIOS.
Just as there are standards that say how connections like USB, LAN etc. should work, there are also standards that components use when reporting to the MoBo/BIOS - the temperature (or fan speeds etc.) will be converted into digital data that follows the standard, so that the readings will be consistent between different set-ups.
You often won't see the temperature sensor as a separate part - in order to get the most accurate reading, it is built into the very same piece of silicon as the actual chip circuitry itself, along with the other circuitry that allows 'protection' features like clock throttling etc.
For this reason, you should always open up your PC once in a while and clean the dust and muck off the fans and heatsinks. As they get more and more dirty, the heat cannot escape so easily, and the temperature rises.
But your CPU is unlikely to burn out - instead, what happens is that it senses the temperature rise and will automatically turn down the clock speed (the faster it goes, the more heat it generates). So a very dirty PC can be running a lot slower than the advertised clock speed - killing the CPU performance. In the very worst case, the machine will just shut down to protect the electronics - I have 'fixed' a lot of friend's 'broken' PC's simply by giving them a good clean!
Feel free to use any schematics and algorithms I post on the forum in your own designs - a credit is appreciated (but not a requirement).
Don't stagnate, mutate to create. Without randomness and serendipity the earth would be just another barren rock.