Various things. Lack of water intake is most common so sweat is concentrated. Bacteria dine on sweat, esp if concentrated so regular hygiene is important as well. Water intake should be half of body weight in ounces. Various foods, medications, supplements can make it worse by causing various scents. Avoid anti-perspirants as they contain aluminum (linked to alzheimers) and choose a scented deodorant.
Underarm smell. Underarm smell is caused by the bacteria which feed on thesweat. The medical term for that is bromhidrosis and for exccesive sweating is hyperhidrosis. To prevent your armpit smell you have to get rid of bacteria by taking frequent baths with deodrant and antibacterial soaps, also you need to control exccessive sweating by using anti perspirant and deodrant. And avoid garlic, onions and curry spices.
See below. Usually it's due to bacterial overgrowth.