Sweating prevents the body from overheating when the temperature outside is elevated. In fact, sweating is our primary mechanism for thermoregulation: the evaporation of sweat from the skin entails a loss of calories in the form of heat.
When energy is released this way, the body’s internal temperature decreases. Without this method of self-regulating, the body’s internal temperature would continue to rise during hot weather, physical activity, or from fever, which could become dangerous and life threatening.
The body loses water due to sweating, and unless that water is replaced, there is risk of dehydration. You can lose a significant amount of water via sweating, from 0.5 liters to over a full liter per hour! So drinking water regularly during exercise is highly recommended, especially for intense cardio activity.