In the former test, whites scored much better than blacks. In the latter, the scores were identical. In other words, when the black students knew that their performance would be used in conjunction with a stereotype about their group's intelligence, they did much worse. This is to say that once a stereotype is established, whether based in reality or not, it can have very real effects. It is a case of perception driving reality rather than the other way around.
Scientific knowledge is a start.
Legal protections help. Public policies have some effect. But the bulk of the problem will only be solved person by person. Not until each person questions those undercurrents of racism we have all learned along the way, will we get anywhere. Ironically, part of the problem is the stigma attached to racism.