Vitamin B12 was discovered from its relationship to the disease pernicious anemia , which is an autoimmune disease in which parietal cells of the stomach responsible for secreting intrinsic factor are destroyed.