Engineering is about developing skills, and all technical skills have a relatively early inflection point of diminishing marginal returns on effort.
Engineering has a high barrier to entry, and women who are in engineering are necessarily in the 80th percentile of intelligence, so let's say they are smart. Smart people have a different apprehension of risk than less smart people.
Roles that involve management, finance, and relationships, have infinite upside, where the benefits of roles that involve skills tend to have a fairly well defined peak.
A woman who is ambitious enough to pass the high bar for engineering is probably smart enough to recognize that for an equal investment of time and effort, if she switches to management or a non-technical role, she can achieve a management role with greater perceived stability, a multiple of salary, bonuses and eventually equity.
Depending on her motivation in regard to having children, a job that requires skill maintenance requires much more effort if she is caring for a child, but _with the same limited upside_. The divided commitment means she has to work some coefficient of effort harder toward the same result. Can she? Of course, but why would she?
Some women are content with this, but I think women avoid STEM work because, decades as a code monkey is not the most productive use of their time. If boring aspies and loud talkers chased women out of jobs, they wouldn't have stuck with "traditional" jobs that include handling rooms full of 40 screaming children, caring for violent drug addicts, serving drunks, etc. Outside academia, women aren't delicate flower petal snowflakes.
The more plausible explanation is that if it were worth it to them, they would do it. For some reason, engineering is still not worth it, and the answer is likely more uncomfortable for men than it would be for women.