Nothign I said in my comment above is my current position, it's a description of the thinking of people who run departments. Note that I very carefully said the idea of whether genders have preferences, is a controversial topic.
In my own field, biology, many subfields do have equal gender ratios (went from skewed to equal over last 20 years). However, having worked in Silicon Valley at tech firms, I can say that they (and the programs that feed them) still have very skewed ratios.
I'm aware of these processes and how long they've lasted; about 100 years ago, Harvard limited the number of Jewish people who could be accepted. Jews were excluded from working at "white-shoe law firms" (the ones that did high-value business deals) and instead generally ran law firms that handled "the dirty stuff" (divorces etc). Eventually, Jews became much more accepted, explicit Jewish quotas at universities were removed, and white shoe law firms hire (and have partners) who are Jewish.