To Regulate Body Temperature
The main reason a human being sweats is to regulate the temperature of the body. Even if you are unaware of it, you sweat out 600 g of moisture from your body every day. The moisture held in your skin is there always as long as you are healthy and hydrate normally. When the temperature outside your body rises above the temperature of your body, the heat begins to enter your body. Your skin regulates your internal temperature by cooling it down. It does this by dispelling water from the body through the sweat glands and pores.
Sweating and Exercise
In exercise, you generate heat from inside your body. Your brain can only handle heat up to 104 degrees F. The heat in your body during exercise comes from your increased heart rate. As it does when the temperature outside your body enters it, your body gets rid of the heat inside your body by sweating it out. Sweating puts off the buildup of heat. You sweat naturally when you are at a lower body temperature. As you increase that temperature, your sweating rate will increase so that your brain does not get to that critical temperature.
Sweating as a Symptom
Sweating can be a symptom of infection or disease. When you run a fever you can sweat in response to the virus making you sick. Intense sweating can also be a response to serious illness requiring medical attention. This kind of sweating makes you sweat all over, in areas you may not normally sweat even when exercising. You may even feel pain from this sweating. If you are a man, having night sweats or "sweating the bed" can be a sign that you need medical attention. However, night sweats are one of the symptoms of menopause in women.
To Release Pheromones
The chemicals in our bodies that attract us to each other sexually are called pheromones. These chemicals are found in all kinds of insects and animals, including human beings. Human sweat in a man contains the pheromone androstenone. When this pheromone is secreted in a man's sweat, he is more attractive to potential suitors at a chemical level. Through the process of evolution, dominant males have adapted to produce higher levels of this chemical in their sweat. This chemical in men, when sensed by women, can increase the level of the stress hormone cortisol.