Those are IgA and IgG antibodies that are being transmitted from mother to child. They're effective for a period of time until the child's immune system develops but do not confer lifelong immunity as the child's immune system creates no memory from it.
There might be other forms of immunity conferred as well. Antibodies provide immediate immunity even before the younglings immune system gets up and running. There's definitely some sharing of immune cells in the womb, who's to tell what else happens there with a long-term plan?