In my experience the majority of new high school grads do not choose their uni program based on a deep passion. Usually, they don't even have one or don't know what it is.
I studied CS in Germany at 2 different faculties, and there was a large discrepancy between the first (~15% non-male), and the second (~35% non-male). The second faculty had a lot more female professors, I also suspect that having a more equal gender ratio benefits an even more equal gender ratio: The idea of being a small minority in your degree is just not very appealing, and the negative stereotypes on male CS students are pretty off-putting to women. These do also seem to hold true for a sad subset of the student body.