How could viruses or bacteria potentially cause autoimmune disease?

How could viruses or bacteria potentially cause autoimmune disease?