The Rh factor is an antigen, a protein which is found on the outer membranes of blood cells. A majority of humans have this antigen on their blood cells, and under normal circumstances it is a harmless feature of the immune system, being one of the many proteins that allow the body to distinguish between self and non-self molecules.
Rh factor incompatibility occurs when a woman who is Rh- (meaning she does not have the Rh protein on her blood cells) becomes pregnant with a child who is Rh+ (meaning that the child does have the Rh protein, a condition that must have been inherited from the father). Duriing the pregnancy, the mother can become exposed to the baby's Rh+ blood. Subsequently her immune system will react to this exposure by creating antibodies to the Rh protein, in effect making her "immune" to it.
While this usually poses no threat to the baby that caused the initial exposure, if this woman becomes pregnant with another Rh+ baby in the future, her immune system will treat that baby's blood cells as if they were some sort of an infection. This causes the baby to be affected with hemolytic disease, which can cause anemia so extreme that a blood transfusion may be required.
Virtually all cases of Rh-caused hemolytic disease are preventable. A woman who is Rh negative should always receive shots of a drug called RhoGAM, which will prevent the woman from making here own Rh antibodies. Generally these shots are given once during the pregnancy (usually at 28 weeks), and again within 72 hours of the end of the pregnancy.