This model and other Samsung tablets usually have this problem when solder joints at battery connector have cracks.
Resolder the battery connector will fix this problem. It is similar like a 20 Amps current run through a 10 Amp wire, it will be overheated and melts the insulation. Current runs through cracked solder joints will create heat and the tablet will pop up message to indicate it's overheating.
It will force a shutdown or prevent any application running.
This is an example, I resoldered the battery connector and did not do well, when turned on, the tablet was overheating right away which hadn't have this problem before

I had to rework the battery connector again and the overheating went away. This is not a guessing opinion as it actually happens to my tablet when solder joints at battery connector are bad.