The image shows the heat dissipation caused by a 10W battery charging circuit without a heatsink or forced cooling. Thermal management is a must in designs. Always follow the datasheet during layouts for the best thermal performance. Here dissipation is mostly via thermal vias and a large ground plane.
Thermal cameras will help you isolate thermal issues in your high-current boards.
Pro-tip for PCB designers: Never Ever give thermal relief for thermal vias. You will reduce the thermal dissipation with those reliefs. Folks usually miss this in design due to the usual habit of creating vias with thermal reliefs.