Sweat glands are very important because they help keep your skin moist and cool you down when you get too hot. It turns out our bodies have 2 types of sweat glands. Eccrine glands are found all over our body and produce clear, odorless sweat. The other type, apocrine glands, are found under the arms and around the groin area. The sweat from these glands can be quite stinky.
Bacteria are microscopic organisms which live on our bodies, in our homes and in fact, everywhere.
It just so happens that there are several species of bacteria which live on our skin. And it also just so happens that these bacteria love to eat and drink sweat. When the bacteria eat the sweat, they later excrete waste products and the waste products are what smell so bad. Our feet are particularly afflicted with foul odors. When we put on shoes and socks we create a perfect breeding ground for bacteria.