We only really develop a proper understanding of gender around the age of 7, but influences before then set up the mindstates to come, and help to drill everyone (including parents and teachers) in appropriate gender roles.
Kids see male doctors and female nurses. They have female teachers at school. When shopping for toys, the girls get pink kitchen sets and dolls, and the boys are offered machines and cars.
From a young age, our society teaches us that women are not engineers, and men are not teachers. We need to solve them both.