Let's look at it through a hypothetical "nerd index". Statistically, there are many more male nerds than there are female nerds. Guys are much more likely to spend inordinate amounts of time in their home shop, garage, or whatever place they are holed in, not eating much, hardly sleeping, working on a project. And it's this kind of persistence and determination to take your technical knowledge and skill to a very deep level. You probably won't be rich, but you will be consulted for things that nobody can even start brainstorming about.
Girls don't care about that kind of deep technical knowledge and skill. They want to have a normal life
Socializing, having lots of friends, and at some point having a family etc. And if a girl also has the looks, her chances of nerding decrease exponentially
It takes a unique personality to go nerd when you can have so many more nice things going for you by just being an attractive girl. So I think it's the lack of motivation and interest in nerding that causes the big gap between male and female engineers.