Pernicious anemia is an autoimmune disease in which antibodies attack gastric cells, resulting in impaired production of intrinsic factor that is critical for absorption of vitamin B12.