Many things affect how teachers grade which are beyond their control. Their grading is certification of your mastery of the subject, and they are comparing your performance with that of students in other classes. You would probably agree that certain talents (sports, acting, music) are individual gifts, but you may feel that in mathematics, learning should be democratic and no one should fail. Actually, teams can fail (as when they lose a game). While knowledge is accessible to everyone, and in that sense democratic, your individual effort is a definite variable in your learning, and it must be your own responsibility to do well. If no one does well on a test and the teacher maintains that the test is fair, a good solution is to review the test with a study group or tutor -- it is likely this material will surface on another test for a second chance.