When a person gets sick, especially from an infectious agent like a bacterium, the body mounts a vigorous inflammatory response, said Dr. Clifford Saper, chief of neurology at Beth Israel Deaconess Medical Center. Among other things, the immune system pumps out hormones that end up in the brain, triggering fever, changes in the sleep-wake cycle (that's why you get so sleepy when you get sick), and appetite.
Losing your appetite during a bacterial infection is actually a good thing, Saper said. Bacteria live on a type of sugar called glucose. When a person gets sick and stops eating, there is less glucose around, which means bacteria essentially starve. The person, luckily, does not, because humans are well-adapted to use an alternate fuel, fat, to keep metabolism going.