Why does the plug in cord get hot?
Because there is electricity running through it.
When you say 'hot' do you mean 'warm'?
All conductors have resistance. Resistance means that when current passes through it some of it will be transformed into heat. You want the resistance to be low as this is wasted energy, could decrease the voltage to an unacceptable level at the load, and the heat may cause damage to the cord or the receptacle it's plugged into.
The heat could be that the cord is too small for the amount you're pulling through it or it could be that the connection between the blades of the plug and the receptacle aren't making a good connection either because there is some mechanical problem or there's corrosion present on them.
Cordage also often has a significantly higher temperature rating.
This allow the use of smaller more flexible conductors with the penalty of power being lost in the cord and heating it up.
If the cord is warm at the plug and nowhere else, that could easily be a problem with the receptacle.
A poor connection will make the receptacle, plug, and cord warm up. If the plug feels very loose (easy ti insert and remove) that could indicate a receptacle problem.
If the cord has a localized warm spot, it may be damaged. Flexible cords use a large number of very thin wires. If the cord has been flexed at the same spot excessively, some of the wires can break. The fewer wires carrying current at the break can make a hot spot.
If the while cord feels about the same, and is not so hot it cannot be touched there may be nothing wrong at all.
What specifically do you have plugged in that you are concerned about?
And cordage assumes pretty much free air. I made the mistake of plugging in a pretty heavy load once (deep freeze in the garage) without unrolling the extension cord fully from the reel it was on. Now the outer jacket is kind of permanently fused together in the coiled up form.
"I made the mistake of plugging in a pretty heavy load once"
A little heat welding is not as bad as the neighbor who had most of 100 foot cord for his electric mower coiled up and managed to actually light the thing on fire.
He then proceeded to try and put it out with his garden hose.
His wife called the FD who came out, unplugged it, and then wasted some CO2 extinguishers on the remains.
At least they new to unplug the darn thing, but then failed to realize it was no longer an electrical fire.
Yep, as I learned early on in my fire department training, you have to have four things to have a fire:
4. A battalion chief
Take away any one and you can't have a fire.
Except electricity creates its own set of problems since it alone can cause things to burn (or melt) that otherwise would not be an issue.
Arc flashes are a hazard in and of themselves, and require nothing but electricity.
Agree with battalion chiefs being required.