Everyone has some kind of body odor, but it may be caused by different things at different times. Regular body odor, the kind that's associated with poor hygiene, is caused by not cleaning sweat from the skin (especially areas like the arm pits) and letting bacteria grow in the sweat. Body odor is also affected by things like the health of a person's liver and kidneys, because if these organs aren't operating to purify toxins from the body, then those toxins will be released through the sweat, skin, and breath. Body odor often develops while a person is asleep, as the body processes continue to purge toxins from the system.
A sour body odor can have a variety of causes. A sour smell is associated with processes such as fermentation, and with dairy products. When food reaches the stomach, it's broken down in a souring process with acid. As this breakdown occurs, a sour smell is released (which is often experienced in the form of sour belching). Once the basic break down of food takes place, it moves into the intestines where further souring occurs. This causes the build up of toxins in a person's body, and these toxin's must be eliminated. This can occur through efforts by the kidneys and liver, but as stated above these toxins may be released through breath, skin, and sweat as well.
A sour body odor occurs especially when food (especially dairy) is left too long in the stomach. Some things that can cause food to stay in the stomach for too long include: overeating, eating raw foods, consuming cold drinks before a meal is actually eaten, eating mostly fat, protein, and starch, weak digestion, eating late meals or eating just before sleeping, and excess weight. There are other reasons than these, of course. However, any of these reasons, when combined with the sluggish state of a person's body during sleep, can easily create a sour smell as food is left in the stomach and the skin tries to release the toxins from the chemical digestion process.