As why many girls make that "decision" at around 12 - they might be smarter and see that they don't have to work that much anymore. Maybe in the past when things like cooking for 10 people family or washing clothes/cleaning were super difficult the partners had to form a team; these days most of this is semi-automated and allows different strategies.
Do you really believe that girls aren't making conscious choice to stay away from "weird smelly" engineers in STEM fields that are now popular wrt. $/status but were completely undesirable 20 years ago? Have you grown up completely isolated from young females and couldn't observe what were their choices? Yes, I have seen a lot of men dissing them "just females, can't be good" (I hated it in my idealistic youth), but then later you observe their choices and they aren't doing themselves any favors either, usually picking "safe choices" instead of risky ones needed for success.