As compared to other electrical devices even the CPU generates heat whenever you are using it and releases maximum heat and its not so good you should release the heat as fast as possible or you are going to damage the processor and you will learn how to measure the temperature of the processor.
The heat is generated because of Joule effect which is held during converting the electrical energy into heat inside the CPU which contains many micro wires which are in charge of it internal interconnection and the joule effect is emerged due to shock between the electrons and conductors ion mesh which tend to increase the temperature of the conductor.
The heat produced by the processor should be dispersed out as fast as you can with the help of powerful CPU fan or the temperature inside the CPU will keep on rising and the internal circuit will get damaged.
The temperature is usually written on the plated body in a coded format and it depend according to the CPU the maximum temperature it can work without any damage if you use proper cooler which will help to keep the temperature below the maximum level and also apply the thermal paste on top of the CPU casting today there are more coolers available in the market for e.g. Water cooler, etc.