It is not complex; if a fair portion of your teachers or even just a couple of them constantly assume you are way less clever than you actually are simply because you are black, and treat you accordingly, you are going to resent them and it will naturally affect your self-esteem and grades.