I usually think of deodorant and antiperspirant as being essentially the same thing. When I refer to by antiperspirant, I call it deodorant. However, deodorant and antiperspirant work by completely different mechanisms. They are also regulated differently. Deodorant is regulated by the FDA as a cosmetic, whereas antiperspirant is an over-the-counter drug.
To understand how deodorant works, you first need to understand one important thing: it's not your sweat that stinks. Your sweat comes out of your body smelling just fucking fine. The problem is that your armpits are bacteria heaven. First of all, they are moist. Secondly, they are intertriginous, meaning that two pieces of your skin are touching each other. Finally, the pH of your armpits is slightly higher than the rest of your skin. The rest of your skin is slightly acidic, which kills off a lot of bacteria; your armpits are much more neutral, making them prime for bacteria breeding. The apocrine and eccrine sweat glands pump out moisture into your underarm region. This feeds the generally benign bacteria living in your pits. In particular, Corynebacterium striatum is known to convert odorless precursors into trans-3-methyl-2-hexenoic acid. This molecule smells like, well... armpits. The way that we don't want our armpits to smell. These bacteria also break down lipids in your sweat into smaller components such as butyric acid, which is sometimes used in stink bombs.
Since there are multiple chemical processes that contribute to body odor, interfering with them all would be a nightmare. So, instead, they are developed to prevent the bacteria that make you smell from wanting to spend a lot of time in your armpits. Deodorant and antiperspirant employ two different mechanisms to solve that problem.
Antiperspirants, on the other hand, work by preventing you from sweating. Consequentially, the bacteria have nothing to convert into nasty-smelling molecules. Antiperspirants contain aluminum-based compounds such as aluminium chloride or aluminium chlorohydrate. The aluminum ions are taken into the cells around the ducts. As a result, water also begins to pass into those cells. These cells begin to swell, closing the ducts and preventing sweat from escaping until the swelling goes back down. Antiperspirants will also typically contain the same sorts of ingredients as deodorant, meaning that they perform double duty. Prescription-strength antiperspirants use the same active ingredients and mechanisms, but at higher concentrations.
Either way, the goal is to leave you smelling like roses. Or, you know... pomegranate and lemon verbena. Whatever.