Mill defines justice as something distinct from general morality by arguing that justice consists of duties in which a corresponding right resides in some person or persons. Moral obligations, in contrast, are duties "which do not give birth to any right."
Justice, to Mill, implies some obligation that someone else can demand from us. Mill argues that because of superior intelligence, man can have regard for his fellow man, whether it be his whole tribe, his community, or his nation, and wish to see justice done against those that harm it. The sentiment of justice, therefore, includes an element that wishes to punish to recompense those injuries inflicted on us by our enemies.
Mill thus denotes Justice as both a "rule of conduct" common to humanity and conducive to its good and a "sentiment" that those who infringe the rules of conduct—either against oneself, one's tribe, one's nation, or humanity at large—should be punished for violation of the rules of conduct to protect humanity, the nation, or the tribe.