The finish line's in sight and you put on an extra burst of speed. As your legs pick up the pace, your breathing gets deeper, your heart pounds faster, and sweat pours over your skin. How does this substance suddenly materialize and what exactly is its purpose? There are a number of scenarios that can make us sweat: eating spicy foods, nervousness, and when we're sick. But exercise is probably the most familiar and common. In that case, sweating happens as a response to movement triggered deep inside your cells. As you increase your pace, your muscles work harder, increasing their demand for energy. A process called cellular respiration consumes glucose and oxygen to form ATP, the energy currency of the cell. Much of this process takes place in structures called mitochondria. The more you move, the harder mitochondria work to supply your body with energy. All this work comes at a cost, though. As the cells break down the ATP, they release heat. The heat stimulates temperature sensors throughout your body. Those receptors detect the excess heat being produced by your muscle cells and communicate that information to the hypothalamus, which regulates body temperature. The hypothalamus responds by sending signals out through the sympathetic nervous system to the sweat glands in your skin. These are distributed all over the body with especially high concentrations on the palms of your hands, the soles of your feet, and on your head. When a sweat gland first receives the signal, the fluid surrounding the cells in its coiled base contains high amounts of sodium and chloride. The cells pump these ions into a hollow tube that runs through the sweat gland. Then, because it's saltier inside the tube than outside, water moves into the tube by osmosis. As what's called the primary secretion builds up in the bottom of the tube, water pressure pushes it up into the long straight part of the duct. Before it seeps onto the skin, cells lining the tube will reclaim as much salt as possible so the process can continue. The water in sweat absorbs your body's heat energy and then evaporates off of you when it reaches the surface, which in turn lowers your temperature. This process, known as evaporative cooling, was an important adaptation for our ancestors. This cooling effect isn't only helpful during exercise. We sweat in many other scenarios, too. Eating particularly spicy food makes some people sweat profusely from their faces. That happens because spices trigger the same neural response in the brain that activates temperature receptors, which usually respond to increased heat. Sweating is also part of the fight or flight response stimulated by stressful scenarios, like asking someone on a date or interviewing for a job. This happens because adrenaline stimulates muscle activity and causes blood vessels to widen, two responses that increase heat and trigger the sweating response. And sweating also occurs when we get sick. When we're feverish, we sweat because infections stimulate the hypothalamus to increase muscle activity, which in turn releases more energy as heat. That increases your overall temperature, a protective mechanism that makes your body less habitable for infectious agents. Like with running, sweating helps your body vent that heat. When the fever's over or you've won your race, your temperature receptors sense the decrease in heat and the hypothalamus brings your sweating response to an end. In some cases, like after a run, the hypothalamus also signals to your body that you need to replenish the water that you've oozed out. So, when you're pushing yourself to reach that next goal, you can think of sweat as your body's very own calibrator, enabling you to go that extra mile.