If you totaled up Christopher Bergland’s athletic achievements, they would be the equivalent of running around the world four times, biking to the moon and back, and swimming across the Atlantic and home again.

The tenacious endurance athlete holds a Guinness World Record for running — 153.76 miles on a treadmill in a single day — and is a three-time Triple Ironman champion, completing the über-demanding 7.2-mile swim, 336-mile bike ride, and 78.6-mile run in a record-breaking time of 38 hours and 46 minutes.

Needless to say, Bergland knows a thing or two about sweat. “When I finished the Triple Ironman, I felt like I’d sweated out every last electrolyte,” he says. Fortunately, Bergland, author of The Athlete’s Way: Sweat and The Biology of Bliss, gets inspiration from perspiration.

“I love to sweat,” says Bergland. “In my mind, sweat equals bliss.”

Sweat is a common partner to exercise, whether it’s the rivulets of sweat that accompany an intense weightlifting circuit or the droplets of perspiration that pitter-patter onto our yoga mats during downward dog.

But outside of the gym, we rarely celebrate perspiration as a positive or desirable thing.

If we think of sweat at all, we consider it an embarrassing bodily function, a sometimes-stinky annoyance, a socially undesirable bit of physiology.

On an exciting first date, palms can get sweaty just as that special someone reaches for your hand. At a job interview, underarms can get swampy from the first tough question. Even in the context of a great workout, sweating buckets can be less than comfortable.

If it weren’t for sweat cooling our bodies down and flushing our toxins out, we’d all perish much sooner.

“Breaking a sweat can create some inconvenience,” acknowledges Bergland, “but the payback is always going to be worth it.”

Why? Because sweat serves a purpose — as a barometer of effort, as an indicator of stress, as a measure of health, and also as a literal lifesaver: If it weren’t for sweat cooling our bodies down and flushing our toxins out, we’d all perish much sooner.

Sweat is a near-universal experience. But how many of us really understand how perspiration works, and why? Here are the fascinating essentials you need to know — the cut-and-dried facts about all things sweaty.

Why do we sweat?

Like it or not, we can’t live without sweat. Perspiration keeps the body from overheating and short-circuiting. When your core temperature rises much higher than 98.6 degrees F, the hypothalamus — your brain’s thermostat — signals the exocrine system’s sweat glands to activate. Perspiration rises to the skin’s surface through pores and evaporates when it hits the air, keeping you cool.

We often sweat during exercise, but plenty of other things can prompt sweating, like a hot summer day or situations that make us feel anxious, embarrassed, or mad.

What is sweat, anyway?

You’ve no doubt noticed that sweat can taste salty. Perspiration is mostly water, with small amounts of fat and electrolytes like sodium, potassium, and calcium. Its makeup differs depending on which kind of sweat gland it comes from: eccrine or apocrine.

Eccrine glands are found all over the body but are most highly concentrated on the forehead, palms of the hands, and soles of the feet. These glands produce a clear, watery fluid when you exercise or are too toasty.

If your feet are stinky, it may be due to an overgrowth of the micrococcus sedentarius bacteria, which grow when feet are enclosed all day.

Don’t blame eccrine sweat for body odor though — this type of perspiration doesn’t smell. If your feet are stinky, it may be due to an overgrowth of the micrococcus sedentarius bacteria, which grow when feet are enclosed in socks and shoes all day.

Apocrine glands, on the other hand, produce a milky fluid that is responsible for B.O. They are found primarily in areas abundant in hair follicles — such as the underarms and genital area — and expel a thick, oily fluid containing fats and proteins. Apocrine sweat doesn’t innately smell bad, but when it interacts with the millions of bacterial organisms (such as staphylococci or corynebacteria) that live on the skin’s surface, it produces a telltale odor.

How much do we sweat?

More than you might think: According to the National Institutes of Health, an average adult can produce up to a quart of sweat per day. Children don’t start reaching those levels until puberty.

How many sweat glands do we have?

We are born with between 2 million and 4 million sweat glands located all over our bodies — except a few places like our lips and ear canals.

Why does my sweat stink when I’m stressed?

Remember the Saturday Night Live schoolgirl character, Mary Katherine Gallagher, who would stick her fingers under her arms and then smell them whenever she got nervous? It’s likely she was getting a whiff of something strong: Sweat produced when we’re under emotional duress is made by the apocrine glands, which are responsible for the stinkiest sweat. What exactly triggers stress sweat is still unclear, though scientists hypothesize it is linked to the adrenaline release that accompanies a fight-or-flight situation, serving as an evolutionary — and odorous — warning signal.

Stress may also cause a vicious circle of sweat: When you notice you’re perspiring a lot, it can increase your anxiety — what if someone notices my wet underarms? — which in turn can make you sweat even more.

Why do some people sweat more than others?

Thank your parents for this one. A big factor in how much you sweat is genetic, determined by exactly how many sweat glands you have. It’s also affected by other factors like gender (see “Sweating and the Sexes,” below), fitness level, health status, and weight.

Heavier people tend to have higher sweat rates, both because they have to exert a lot of energy during physical activity and because there is more body mass to cool down. Surprisingly, though, the sweatiest people in the gym are often the fittest.

Surprisingly, though, the sweatiest people in the gym are often the fittest.

“People who are highly fit generally maintain a higher sweating rate, due to more muscle mass (which is heat-producing) and having a greater blood volume and circulatory system, along with a greater sweat-gland capacity and sensitivity,” says Michael Bergeron, PhD, fellow of the American College of Sports Medicine and executive director of the Sanford Sports Science Institute and National Youth Sports Health & Safety Institute. “And, of course, the more fit you are, the longer and harder you can exercise, and thus, the more you will sweat overall.”

Does sweat change with age?

There’s a reason babies and little kids smell sweet: Their apocrine glands aren’t yet active. Once puberty hits, and the apocrine glands start functioning fully, body odor can become an issue.

Another shift happens in midlife. About 75 percent of women experience hot flashes and sheet-soaking night sweats during perimenopause and menopause. This excessive sweating is probably caused by changes in reproductive hormones and changes in the body’s thermostat, says Rebecca Thurston, PhD, director of the Women’s Biobehavioral Health Laboratory at the University of Pittsburgh. “The central thermostat of the body malfunctions during menopausal transition,” she says.

Women can experience hot flashes or night sweats for several years: “We used to think the duration that a woman will have hot flashes and night sweats was three to five years,” says Thurston. “But the newest data shows that they can last much longer — about a decade on average.”

Some doctors prescribe hormone therapy to ease the discomfort of night sweats, but many are working to develop nondrug approaches. Studies have shown that not smoking, maintaining a healthy weight, and using herbs like black cohosh may help, and Thurston notes that “the most effective behavioral treatment right now is hypnosis — believe it or not — with cooling suggestions.”

What does the scent of sweat tell us?

Sweat may play a role in nonverbal human communication. The “sweaty-T-shirt study,” for example, conducted by Swiss biologist Claus Wedekind in 1995, found that women rated most pleasant the scent of men whose genes were most unlike their own, ensuring a stronger immune system for their offspring. Talk about chemistry!

Sweat can also speak poorly of us: Research published in PLOS ONE in 2013 shows that women’s stress sweat can make men perceive them as less confident, competent, and trustworthy.

And a report published in Psychological Science finds that we can detect other people’s emotions, thanks to sweat. In fact, researchers from Utrecht University in the Netherlands suspect that sweat’s scent actually makes emotions contagious.

In the study, underarm sweat was collected from men as they watched scary scenes from The Shining and gross-out clips from the TV show Jackass. When women smelled the “fear sweat” samples, they opened their eyes wide and had a frightened expression. When they smelled the “disgust sweat,” they grimaced.

Why do some people sweat excessively?

About 3 percent of the world’s population has hyperhidrosis, which causes someone to sweat a lot — four to five times as much as the average person.

“Primary hyperhidrosis, while not life threatening, is certainly life altering,” says Lisa Pieretti, executive director and cofounder of the International Hyperhidrosis Society. “The extreme embarrassment as well as actual functional impairment can be devastating. But thankfully, we see great improvement in the treatments being offered and the awareness of both the public and medical communities.”

While primary hyperhidrosis appears to have a genetic component, secondary hyperhidrosis can result from an underlying condition, such as lymphoma, hyperthyroidism, or diabetes, or as a side effect of medication. Treatments include Botox injections, iontophoresis, and even surgery, though some doctors suggest that hyperhidrosis can be vastly improved with food-intolerance testing and by the removal of any offending foods from the diet.

Should I be concerned if my sweat suddenly smells different?

While it’s normal for foods like garlic to temporarily alter body odor as their chemical compounds are excreted through our pores, strong B.O. can, infrequently, signal a health issue. Trimethylaminuria is a rare genetic disorder that causes sweat to smell like rotting fish or eggs. Research has also linked certain body odors to kidney failure, schizophrenia, and olfactory reference syndrome (ORS), a delusional condition in which the patient believes he has a bad body odor, but in reality doesn’t. These conditions are rare, but should be addressed by a medical professional.

Why do certain clothes smell worse than others after we sweat?

A study published in the journal Applied and Environmental Microbiology shows that polyester apparel is much stinkier than cotton clothing after a hard workout, because it is less absorbent and promotes odor-causing bacteria.

“We investigated the microbial growth on both textile types and it appeared that different microbial growth occurred,” says Chris Callewaert, researcher at Ghent University in Belgium and the website DrArmpit.com.

“Polyester was a source for micrococcus enrichment, which was not seen on cotton. Micrococci are known for their enzymatic capacity to degrade fatty acids and amino acids into volatile malodorous compounds. These microbes are also an important reason why polyester is stinkier after exercise.”

Like natural cotton, wool can help you avoid a smelly clothes hamper. While wool will permit microbial growth, it breeds mostly nonodorous bacteria.

Workout wear is often made from synthetics like Lycra and polyester, which can wick away sweat but hold on to body odor. Specially formulated detergents can help dissolve the oils that interact with bacteria and cause the smell. Antimicrobial sportswear can also help reduce the microbial numbers, but they come with their own risks (see “Why Anti-Odor Clothes Stink“).

These measures prevent the sweat absorbed into the treated material from becoming stinky. But be forewarned that bacteria on your skin can still transform the sweat molecules into something malodorous.

Is it possible to sweat too little?

Yes. Sweating too little — a condition called anhidrosis — can be life-threatening, because the lack of sweat can lead to heat exhaustion or heat stroke.

Anhidrosis happens when your sweat glands stop working. It may be caused by nerve damage, burns, certain medications, genetics, or dehydration.

If anhidrosis affects only a small area of your body, it’s typically not harmful. If you can’t sweat from a large area of your body, however, it’s wise to seek professional counsel.

Do certain foods make us sweat?

Just like hot weather, hot-tasting foods raise your body temperature, affecting the receptors in your skin that tell the nervous system to kick into cool-down mode and produce sweat.

In addition to five-alarm chili and kicky curries, substances like caffeine, nicotine, and certain prescription drugs can also stimulate the sweat glands. And drinking large amounts of alcohol promotes profuse sweating, too, by increasing your heart rate and dilating the blood vessels in your skin.

Extreme food-related perspiration is called “gustatory sweating,” or Frey’s syndrome. While it is sometimes linked to conditions like diabetes and Parkinson’s disease, many cases happen after trauma to a parotid gland — the largest salivary glands. When damage occurs, an individual may sweat when he or she is supposed to salivate.

What are the health benefits of sweating?

Aside from its temperature-regulating effect, sweating has been shown in recent studies to excrete toxins, including arsenic, mercury, lead, and cadmium, as well as rev up circulation and clear the pores.

Researchers have found that exercise is not the only way to reap these rewards — saunas can be a part of your sweat-inducing regimen. Infrared saunas, in particular, which heat the body without warming the surrounding air, can provide such benefits as improved circulation and pain relief. Scientists are exploring the use of this therapy in treating health issues like rheumatoid arthritis and high blood pressure.

Still, many experts contend that perspiration’s key benefit is preventing overheating — not ridding our bodies of unwanted pollution — noting that sweat’s detoxification powers are mild compared with that of our kidneys and livers.

How do I know if I’m getting dehydrated from sweating?

To keep on top of hydration, the American College of Sports Medicine recommends paying attention to how much you sweat. Calculate your body’s sweat rate by weighing yourself before and after an hour of exercise, then add the difference to the amount of fluid you drank during the workout. Use this number to know how much you need to drink to replace fluids and electrolytes (aim to replace all lost during exercise), rather than just relying on how thirsty you are.

Is sweat the sign of a good workout?

Sweating is definitely a sign that your body is working hard: The more intense the activity, the more heat your muscles produce, and the more you sweat. But even with little sweat in sight, you might still be getting a great workout. Remember that not everyone sweats the same amount, and sweat can evaporate quickly, especially if you’re exercising outdoors on a nice, breezy day or inside in an air-conditioned gym.

Does sweating protect me from overheating?

Not necessarily. In order for sweat to cool us down, it needs to evaporate into the air, and humidity makes that difficult. For this reason, experts warn against overdoing it at hot-yoga studios; when exercising outdoors on a hot, humid day with little-to-no wind; or when sitting in a steam room. The sweating itself isn’t dangerous, but humid environments can make it ineffective.

“You will still sweat — a lot! But sweat beading up on your skin and rolling off onto the ground is not helping you to regulate temperature,” says Bergeron.

The Science of Stink Several factors, in addition to your emotional state, can influence your body odor: People of East Asian descent are less likely to have B.O. than their European and African counterparts thanks to ABCC11 gene variations thought to play a role in the excretory function of apocrine sweat glands.

A study from Charles University in the Czech Republic found that heavy meat-eating can make your sweat smell worse. Researchers collected the underarm sweat of men on meat-eating or vegetarian diets. Sniffers rated the non-meat-eaters’ sweat significantly more pleasant.

Some people are blessed with especially stinky feet, thanks to an overgrowth of the bacteria micrococcus sedentarius , which emit a sulfuric smell.

, which emit a sulfuric smell. Be sure to thoroughly dry off after a shower: Damp skin can encourage bacterial and fungal overgrowth, which interacts with apocrine sweat to produce odor.

The sweat of identical twins smells the same, according to a study published in Journal of the Royal Society Interface , even when they don’t eat the same foods.

, even when they don’t eat the same foods. If you have yellow, sticky ear wax, you’re more likely to have strong body odor. If you have white, flaky ear wax, you’re less likely to smell, according to a 2009 BMC Genetics study.