There are two reasons we habitually apply a barrier to our underarms: sweat and smell. You wouldn't be the first to assume that the former causes the latter, which means you're not the first to be wrong.
Sweat actually doesn't smell. It's the bacteria that builds up in that little crevice we call an armpit that causes the pong. Of course, this doesn't take perspiration off the hook – no one likes to look down and discover that telltale half circle of darkened material on their shirt.
While their names indicate their differences (antiperspirant and deodorising), they have somehow slipped into the same column. Deodorants have antibacterial agents that help reduce and mask body odour, whereas antiperspirants reduce sweat by using aluminium salts to clog pores and trap perspiration. Some brands combine the two.