You have a Human Leukocyte Antigen (a recognition antigen) in your cells which tell other cells that you are one of them.
In the cases of blood transfusions and organ transplants, the antibodies recognize that the transplanted organ/blood is not compatible (since it does not have the same HLA as the body), so it attacks it aggressively, leading to organ failure or embolism (blood clumping).
For pregnant mothers, we humans have factors called Rh. In the ase of intermarriages, a father might be Rh-, and a mom Rh+. If the fetus conceived in the mother is a Rh-, the mom's Rh+ will attack it. The doctor then prescribes anti-Rh injections so the mom's antibodies won't attack the fetus.