Rheumatoid arthritis develops when the immune system produces antibodies that attach to the linings of joints. Immune system cells then attack the joints, causing inflammation, swelling, and pain. If untreated, rheumatoid arthritis causes gradually causes permanent joint damage.