Sweating is a necessary bodily function -- it cools down our bodies when we're hot (although for some of us, it also happens when we're nervous). But like so many other body functions, it's considered pretty distasteful. Unless you're exercising, visible sweat is often associated with being unclean -- and let's not forget the body odor that can come with it. Because the sweat glands responsible for body odor are highly concentrated in the underarms, most of us apply some type of combination deodorant/antiperspirant both to keep down the amount of sweat that we produce and to cover up any potential odor. So when we say "deodorant," we typically mean this combination product.
As you might imagine, deodorant is a fairly modern invention. The first deodorant patent, for a product called Mum, was issued in 1888, and it soon took its place in the bathroom as an essential personal hygiene product. Most deodorants today use some type of aluminum compound, such as anhydrous aluminum zirconium tetrachlorohydrex gly. This ingredient closes the pores in your underarm skin, preventing sweat from escaping. Some aluminum-zirconium compounds also absorb any sweat that you do release.
Unfortunately, some people are allergic to aluminum or zirconium. There's also some controversy about the potential toxicity of these compounds. If you find yourself with itchy armpits after using a deodorant/antiperspirant, you may need to try different types to find one that works for you. Or, consider a natural product. Most of them are pure deodorants instead of combination deodorant/antiperspirants. Body odor is actually caused by bacteria on the skin, not the sweat itself, so unless you have a problem with excess sweat, these products may work for you. Some are made with potassium alum, a mineral salt, or include essential oils that are both astringents (which dry out the skin) and have a pleasant aroma.