Immune hydrops fetalis is primarily caused by Rh incompatibility between the mother and fetus. This condition arises when an Rh-negative mother carries an Rh-positive fetus, leading to maternal antibody production against fetal red blood cells. These antibodies can cross the placenta, causing fetal hemolytic anemia, heart failure, and subsequent fluid accumulation.