Researchers are said to have linked the diseases to malfunctions in the body's immune system, leading it to affect appetite. The discovery could offer new ways of treating the conditions suffered by around a million in the UK.
High-profile sufferers have included Diana, the late Princess of Wales, and the former Spice Girl Geri Halliwell.
Researchers at the Karolinska Institute in Sweden have identified high levels of a particular group of antibodies in those people with the eating disorders.
The antibodies that are generated to fight common bacteria such as E coli and Helicobacter pylori could have a role in attacking chemical messages controlling appetite, it is claimed.
Professor Tomas Hokfelt said: "Our data reveal that core psycho-behavioural abnormalities characteristic for eating disorders correlate with levels of antibodies."
Susan Ringwood, chief executive of the Eating Disorders Association, said: "There is already some research suggesting eating disorders can follow an infection, so this is very interesting."
As yet it is unclear whether the link is significant. The higher levels of antibodies may yet turn out to be a result - not a cause - of the semi-starvation suffered by suffers of anorexia and bulimia.