For example, a British woman that graduates from a British university with a history degree and wants to work in the UK probably met a couple people during the course of her degree (or at any other point) that can help her move forward with a career. Because let's face it, you're not going to get a high-paying job with high marks in your History BA and nothing else. As such, her prospects will be better in her field of study or in a reasonably related field (or any field where having contacts strongly helps and where she has made such contacts).
Meanwhile, an immigrant will be much, much less likely to have such local connections/contacts. Presumably then, immigrants will gravitate towards fields where getting into them / your pay grade is more closely based on competency and not "who you know". In other words, fields like STEM or (in your case) anything which requires a PhD.
Could that not be an explanation for your experience?
I think a simpler explanation is that people choose a career in their countries for whatever reason (that I don't know and can't speculate about) then when demand for their skills rises, they may find that emigrating is a better choice than staying at home- for instance, because salaries are better abroad.
That would be a simpler explanation for why more women in IT professions are immigrants to the UK (and possibly the US, though I'm not sure): they got the skills, there's job offers, they go abroad and take the offers.