The immune system mistakenly targets and attacks the body's own cells and tissues, producing antibodies that can cause autoimmune diseases.