Autoimmunity is caused by Increased Intestinal Permeability Syndrome aka Leaky Gut where the body reacts to food molecules which are absorbed into the bloodstream undigested. This is caused by a bacterial infection where the bacteria create a biofilm which replaces sections of the digestive mucosa which allows undigested food to enter the bloodstream because it benefits the bacteria. They create a feedback loop which takes advantage of normal body processes.
The only viral element could be due to the stress on the immune system leading to viruses not being dealt with as the immune system struggles to deal with the onslaught from food proteins and waste products entering the bloodstream.