There are several causes of pernicious anemia. These include a weakened stomach lining or a problem with the body's immune system, which causes it to attack the intrinsic factor. In some rare cases it can be passed down through families. Treatment is usually a regular injection of vitamin B12.