Carol Dweck's research on how mindset can affect educational performance [1] is probably relevant in this context. Importantly, the belief that ability can be improved with practice rather than being inherently limited by innate characteristics (including, but not limited to gender) by itself appears to be a pretty powerful factor in either supporting or limiting growth.
I suspect that having not just role models like yourself, but them also being commonplace can more easily dispel beliefs that your room for growth is limited by gender, ethnicity, etc. Obviously, if your field is already dominated by people like you, this is not a problem that you have to deal with in the first place.
[1] https://www.ted.com/talks/carol_dweck_the_power_of_believing...