Engineering and physics have similar ratios around 10% to 20%, while maths is way higher around 50/50 (the rates for the classes I was taking were actually higher, but that's another story). Chemistry here also is mostly women.
The only hypothesis that fits my (admittedly anecdotal) experience, is that there's quite a difference in the interests of men and women, and that the country differences in enrollment are more a symptom of how the curricula are structured.
For example, Spain does not have CS degrees structured like in the anglosphere, so depending the subfield you intend to work on, you should go to engineering instead. Most of the women I met at engineering would have chosen a CS degree over engineering if there was one. I have seen stark differences too in physics, were the majority of women there wanted to pursue pure theoretical physics with pretty much none of them showing interest in applied physics.
Edit: It can also become weirdly specific; participation in computer science and physics remain quite low here (Ireland), say, but I believe most chemistry undergrads are now women.