It's school.
And that's why we sent our DDs to an all girls' grammar school, which is also a specialist maths and science academy. Chatting with my DDs and their friends it's clear it doesn't occur to them that they might be inferior, either socially or academically, to boys.
They just take it as read that they are academic, and 'good' at maths and sciences etc. They are very comfortable with the idea of becoming doctors, engineers, scientists etc. It probably helps that their school always whups the boys' grammar at GCSE & A level results too 