True, but it also happens this way:
Dislikes you>>competence
A professor targeted my papers and subtracted points subjectively on every paper. On the final, she gave me a grade, then went over about eight different problems and gave me a lower grade for all of them. The old grade is clearly crossed out. Coincidence? Hell no. It was just enough to lower my grade by one. I finally got fed up and took action. Only then she left her denial stage and faced what I really knew and could do.
I don't know how often this happens, but some professors have issues. Even worse, some TAs have competitive insecurities: one TA took off like 20% of my grade from a report. I talked to the teacher and just after reading that part once, he gave all of the points back without question and was very uneasy as to why that had happened. I didn't even ask why and left it at that...
So chances are that often your grade is subjective and in borderline cases a humane discussion may be apropos. It is unfortunate, but many teachers grade you subjectively. I have had also cases where I got points off for certain things at the beginning of the course, then as the teacher or the TA got to know who I was, I began noticing that many of my mistakes (very similar ones) were dismissed and I lost no points. In this case it is not too bad since they likely knew that my understanding of the material is very good. This is especially true for top schools. At a CC they don't give a one damn!
So everything can affect your grade: your looks, what you wear, how you behave, how articulate you are, etc. When you are stopped out of the blue as you are walking out of the class and are told how you "look" like a doctor, etc, you can be pretty sure that there is a positive bias. On the other hand, if the teacher dismisses your point by bringing up an unrelated hypothesis, you know you're in deep ****.