How can the child and the mother have different blood types?
The blood of the fetus does not mix with the blood of the mother.  Instead, the placenta provides a system where the two separate blood streams flow past each other with thin separation allowing nutrients to flow between the two streams but the not the blood cells and other large components.