Research has shown that people diagnosed with eating disorders have significantly higher rates of certain autoimmune disorders than the general population, including Addison's disease, celiac disease, ulcerative colitis, Crohn's disease, type II diabetes, and possibly more. 
In spite of this, there does not appear to be any single genetic mechanism that links eating disorder with the wide range of different autoimmune disorders listed above. While a direct link does not seem to be the answer, it is possible that there is a common factor that causes both.
Which came first, the autoimmune disease or the eating disorder?
Autoimmune diseases are illnesses which cause the body to develop “autoantibodies”, small proteins that deviate from their normal function, and instead, fight with other proteins in our bodies. The hygiene hypothesis, suggested in 2012 by Acres et al, suggests that anorexia nervosa itself may be an autoimmune disease.
Acres argues that in some cases, delayed exposure to certain common bacteria can confuse the body, and cause it to attack the proteins and nerve cells that regulate appetite, leading to disordered eating.
When the body is exposed to a wide variety of bacteria early on in life, it develops a healthy microbiome, the collection of bacteria that inhabit the body to protect it and maintain health. However, when the microbiome of the gut is disrupted, known as gut dysbiosis, the body’s health may become compromised. Several theories have been developed about the relationship between this disruption, autoimmune responses and eating disorders.
Psychological stress seems to play a key role: stress can cause gut permeability, allowing the contents of the gut to enter the bloodstream, causing an immune response. This immune response then sends a signal to the brain that something is going wrong in the gut, which can lead to changes in food intake and increased anxiety.
Proteins called pro-inflammatory cytokines may also be culprits.9 They cause the inflammation that leads to autoimmune disorders, and there is a possibility that production of these cytokines may, in some cases, be initiated by eating disorders.
Recent evidence has shown that long-term calorie restriction itself may cause gut dysbiosis.
Moreover, the gut dysbiosis caused by a long-term eating disorder has been shown to perpetuate low body weight and prolong recovery, making it that much more difficult for patients with eating disorders to return to their normal habits.
Is it the biological effect and stress of having an autoimmune condition which may necessitate strict eating habits that leads to disordered eating? Or is it the eating disorder’s negative effect on the body that leads to an autoantibodies, cytokines, and/or general stress and causes an autoimmune disease?
Though research is showing a strong connection exists, science has yet to demonstrate which comes first.
While the research is still developing, we must increase our awareness of the many possibilities that influence biological and psychological disruptions within the body. It is important to consider the reasons behind a restrictive diet, and how it may be affecting health:
Could some autoimmune cases be caused by an eating disorder?
Could gut dysbiosis be due to stress or restrictive eating?
Can intuitively eating a wider variety of foods decrease symptoms?
Over time, through eating disorder treatment, perhaps the gut can heal and lead to symptom relief.
 Wotton CJ, James A, Goldacre MJ. Coexistence of Eating Disorders and Autoimmune Diseases: Record Linkage Cohort Study, UK. Int J Eat Disord. 2016; 49:663-672.
 Raevuori et al. The increased risk for autoimmune diseases in patients with eating disorders. PLoS One. 2014; 9(8): e104845.
 Acres MJ, Heath JJ, Morris JA. Anorexia nervosa, autoimmunity and the hygiene hypothesis. Medical Hypotheses. 2012; 78: 772-775.
 Gorwood et al. New Insights in Anorexia Nervosa. Frontiers in Neuroscience. 2016; 10(256): 1-21.
 Herpertz-Dahlmann B, Seitz J, Baines J. Food matters: how the microbiome and gut–brain interaction might impact the development and course of anorexia nervosa. Eur Child Adolesc Psychiatry. 2017; Epub ahead of print.
 Morita C, et al. Gut Dysbiosis in Patients with Anorexia Nervosa. PLOS ONE. 2015; 10(12): e0145274.