MacBook Pro 16" running hot
Idle does not mean the CPU stops. The CPU can never actually stop. At best, the CPU can go into a continuous loop, but this still requires the use of electricity. This use of electricity produces heat. 

Idle means the operating system is waiting for something to do. In this case, the CPU may be use less electricity, but the electricity usage does not go to zero. I would image the temperature is more a function of the fan speed, which I assume in a correctly working Mac is high enough to protect the hardware.