There are reasons besides differences in smartness and racism that can lead to some people not making it past a difficult weed out class, especially one in a STEM field.
For instance, students from wealthier backgrounds are more likely to have had serious prior exposure to computer science before coming to Stanford, such as through high school computer science classes with well equipped computer labs. Students from much poorer backgrounds might not have had these pre-college opportunities.
This can make their first CS class harder for them--especially when it is a weed out class at a top CS school.
So you might have four kinds of students.
1. Those who had significant CS experience before Stanford, and came to Stanford with the intent of majoring in CS.
2. Those who had significant CS experience before Stanford, but came intending to major in something else, but are taking the intro CS course to see what CS is like.
3. Those without a significant pre-Stanford CS background, but came intending to major in CS.
4. Those without a significant pre-Stasnford CS background, and came intending to major in something else, but are taking the intro CS course to see what it is like.
Those in group #1 will have the best chance of not getting weeded out.
Those in #2 will also have a good chance, because of their background.
#3 is more iffy. Their school background lacks CS, but they intended to be CS majors, so many of them will have self-studied CS to make up for their poor formal education.
#4...these people are going to have a seriously hard time. They are much less likely than the #3 people to have done anything to make up for their high school's inadequacies in CS.
I'd expect the distribution of minorities among these four groups to skew towards #3 and #4, and so I'd expect them to get hit more by the weed out class. This is not because they are not as smart--they are just not as well prepared coming in due to inequalities in pre-college education.
TL;DR: the pipeline problem doesn't start at college.
For instance, students from wealthier backgrounds are more likely to have had serious prior exposure to computer science before coming to Stanford, such as through high school computer science classes with well equipped computer labs. Students from much poorer backgrounds might not have had these pre-college opportunities.
This can make their first CS class harder for them--especially when it is a weed out class at a top CS school.
So you might have four kinds of students.
1. Those who had significant CS experience before Stanford, and came to Stanford with the intent of majoring in CS.
2. Those who had significant CS experience before Stanford, but came intending to major in something else, but are taking the intro CS course to see what CS is like.
3. Those without a significant pre-Stanford CS background, but came intending to major in CS.
4. Those without a significant pre-Stasnford CS background, and came intending to major in something else, but are taking the intro CS course to see what it is like.
Those in group #1 will have the best chance of not getting weeded out.
Those in #2 will also have a good chance, because of their background.
#3 is more iffy. Their school background lacks CS, but they intended to be CS majors, so many of them will have self-studied CS to make up for their poor formal education.
#4...these people are going to have a seriously hard time. They are much less likely than the #3 people to have done anything to make up for their high school's inadequacies in CS.
I'd expect the distribution of minorities among these four groups to skew towards #3 and #4, and so I'd expect them to get hit more by the weed out class. This is not because they are not as smart--they are just not as well prepared coming in due to inequalities in pre-college education.
TL;DR: the pipeline problem doesn't start at college.