Imam Ali (AS) described justice as observing the rights of everyone and putting everything in its place.
It is necessary to understand that justice does not necessarily mean equality; for instance, it is not just if a teacher gives the same score to all students regardless of their performance. If done, it will be a violation of the rights of those students that have studied the lessons.
The fairness of a teacher requires him/her to give different scores to students because there is a strong reason behind these differences. Therefore, any sort of apparent inequality or difference is not oppression as long as there is wisdom behind it.