Justice, iustitia, is defined in the tradition by the Roman jurist Ulpian's formula, preserved in Justinian's Digest and quoted by Aquinas: the constant and perpetual will to render to each his right. It is the only cardinal virtue that concerns the will rather than the appetites or the intellect, and the only one whose object is other people, which is why Aquinas ranks it highest of the four. The tradition divides it into commutative justice, governing exchanges between individuals, distributive justice, governing what a community owes its members, and legal or general justice, governing what members owe the community; a fourth category, social justice, was articulated in Catholic teaching from the nineteenth century onward. Related virtues include religion, understood as what is owed to God, piety, what is owed to parents and country, and gratitude.
Aristotle's Nicomachean Ethics, Book V, first drew the distinction Aquinas later systematized, between general or legal justice, ordering the individual to the common good, and particular justice, itself divided into distributive justice, apportioning goods according to merit or need, and corrective justice, restoring an unjust imbalance created by one party's wrongdoing against another. Historians of Catholic social thought generally credit the Italian Jesuit Luigi Taparelli d'Azeglio with coining the specific term social justice in the 1840s, decades before it entered official Catholic teaching through Pope Leo XIII's 1891 encyclical Rerum Novarum, which used the underlying concept, though not always that exact phrase, to address the conditions of industrial labor.