A child in the womb carries foreign antigens from the father as well as immunologically compatible self-antigens from the mother.
One might expect this condition to trigger a graft rejection, but it does not because the uterus is an "immunologically privileged" site where immune responses are somehow subdued.