Basically, students who were previously exposed to CS education in high school excel in the introductory courses and often downplay the difficulty of the concepts. This is a very male-oriented perspective to take.
That's why programs like Girls Who Code try to address the gap earlier in the pipeline, since it's hard to fundamentally change the attitudes experienced individuals have in early CS courses. Other approaches some schools have tried include separating intro CS courses by prior experience.
Interestingly, studies have shown that women who stick with the CS curriculum perform as well their male counterparts in higher-level CS courses regardless of their initial exposure to CS, though women often think more poorly of their own abilities [2].
[1]: https://newsroom.ucla.edu/stories/cracking-the-code:-why-are... [2]: http://dl.acm.org/citation.cfm?id=3017771