I mean it's hard to really say unless you list temperatures. You can measure with many tools; iStat, Macs Fan Control, all sorts of options.
As for plugged into the wall being warmer that makes sense since extra energy is being used to not just run the laptop, but to run it and charge it at the same time. Most of the heat is in the power brick but some is inside the laptop.
And is it a 13" or 16"?
Also; Metal laptops often use the chassis as part of the cooling system to dissipate heat, meaning the chassis will get warmer, while plastic ones often can't really do that. This means metal laptops will feel warmer though the internal temperatures of the components may not necessarily be
[automerge]1595379891[/automerge]
Furthermore; Macs tend to start spinning up the fans later than Windows laptops. You can configure this differently yourself if you prefer to keep it cooler at a cost of battery and noise. But the defaults are perfectly safe for the hardware. Apple just prefers running fast and quiet than turning down the performance and spinning up the fans.
[automerge]1595379943[/automerge]
One last thing; Another thing you can do if you don't need the speed and want to reduce heat is disable Turbo Boost with Turbo Boost Switcher if your processor is supported by the software. Keep it on for speed, but turn it off if you just want it to run cooler for a bit