Anyway, by secreting water onto the surface of the skin, the heat energy in your body can get transferred into the water and evaporate away. This is how sweat acts as a mechanism to keep your body's temperature cool during exercise. During exercise, the heat generated by muscle function can elevate the body temperature dangerously high. Sweating is a way to cool you down. Because dogs don't have sweat glands, they lose heat by excessive panting.
Pigs solve the same problem by simply lounging in the mud.
Now, back to our question of why tennis players change their shirts periodically. After a short time playing in the hot sun, their shirt may be fully saturated with sweat. When this happens, the shirt blocks the evaporation of the water and so the cooling mechanism is no longer effective. If the body can't cool itself, then the body's core temperature rises. If the body temperature rises high enough, it could result in brain damage.