I've always been told that the best way to keep anything from getting
 out of hand is to nip it in the bud before it starts.  I try to apply 
that philosophy to every part of my daily life, whether it be at home or
 work.  That also applies to how I approach the subject of body odor.  
Now, it's not something that can be eliminated completely, but 
understanding what are the main causes of body odor can go along way 
towards preventing it.  
Bacteria - There are hundreds of different types of bacteria that 
live on the human body.  These microbials do their day to day thing with
 very little effect on us.  The one side effect they do have is the 
production of acid compounds that smell.  Bacteria, as with any living 
thing, needs to feed.  Their food happens to be proteins found in our 
sweat.  As they consume these proteins, they release waste in the form 
of acids such as propionic acid which as a strong vinegar odor.  
Different bacteria produce different types of waste products and they 
can range from the smell of onions to rotten cheese.  
Sweat - The body has two types of sweat glands, apocrine and eccrine.
  Apocrine sweat glands are the ones found under the armpits and are 
responsible for body odor.  The sweat produced from these glands are 
thick with proteins and fats.  In addition, it contains odor compounds 
produced by the body.  Bacteria feed on this sweat and release molecules
 that cause body odor.  In addition, the sweat itself is shown to 
contain certain odor compounds that are responsible for body odor.  
Food - Much of what you eat can contribute to how you smell.  Certain
 foods contain high amounts of sulfide compounds which get released into
 the body during digestion.  They get absorbed into the system and are 
released through the skin, sweat and pores.  Garlic, onions, meat, 
seafood, eggs, beans and spicy foods are known to be high in sulfide 
compounds.  
Genetics - We aren't all born alike, and that certainly applies to 
how we smell.  Some of us are born with fewer apocrine sweat glands 
which as was noted earlier, is a prime source of body odor.  In 
addition, scientists have recently found what they are calling the body 
odor gene.  Named ABCC11, this gene is shown to influence the activity 
and odor compound production of apocrine sweat glands.  This  gene is 
found in about 2% of the population.