You might be thinking that you already know the cause of underarm odor: sweat. But the fact is that sweat itself doesn't have a smell. Perspiration is primarily composed of water and salt. Underarm odor isn't caused by your sweat, but instead by the bacteria that's attracted to the places where you sweat the most, such as your feet, thighs or underarms [source: Clark].
To understand the causes of underarm odor, first you have to understand how your body sweats. Your body contains two types of sweat glands: eccrine and apocrine. Eccrine glands open directly onto the surface of your skin. For example, when your palms sweat, that perspiration comes from the eccrine glands. Apocrine glands open into your hair follicles, secreting a thicker sweat that is usually connected to underarm odor [source: Clark]. Because the areas of your body that contain apocrine glands also tend to be places that are warm and confined, the moistness can cause them to become a breeding ground for the bacteria that causes body odor.
Bromhidrosis, or extreme body odor, is generally linked to apocrine sweat and its bacterial breakdown. However, sometimes eccrine sweat can also lead to this unpleasant odor, such as when it softens the protein keratin on the surface of the skin, or when a person has consumed certain foods.
Sometimes, bromhidrosis can be caused by health issues such as obesity and diabetes, because they are associated with other conditions that encourage bacteria growth. One such condition, for example, is hyperhidrosis, which consists of excessive sweating from the eccrine glands. The moist environment created by hyperhidrosis creates ideal conditions for an overgrowth of bacteria [source: Rehumus].
If you've got a taste for garlic, onions or hot chili peppers, you could be making your body odor worse. To learn more about how what you consume affects body odor, continue reading.