It is probably the most likely cause when it comes to game console not working at its best. PS4 essentially is a custom built gaming computer with the same components as a powerful PC. As we all know, powerful electronic things tend to function on high temperatures, which isn’t the best for those silicone APUs inside your game console.
The Accelerated Processing Unit (APU) is a device, which you will find soldered on the mainboard inside of your PS4. AMD is a manufacturer, and it hosts CPU and GPU inside of a single component. Therefore, during these gaming sessions your game console, specifically, APU, can heat up to 90C degrees and needs to be cooled down. For instance, the machine completes cooling via heatsink attached on top of APU. Then it is further cooled down by pushing cold air via an integrated fan inside your game console.
Once any of these components do not function as they suppose to, e.g. poor heat transfer between APU and heatsink, faulty cooling fan or even dust accumulation causing insufficient airflow, your PS4 overheats. High temperatures inside your PS4 causes damage prevention mechanisms to kick in and throttle down APU operating speed, which is experienced as freezing or temporary lag on the screen.