Humanity is a virtue associated with basic ethics of altruism derived from the human condition.
Humanity differs from mere justice in that there is a level of altruism towards individuals included in humanity more so than the fairness found in justice. That is, humanity, and the acts of love, altruism, and social intelligence are typically person to person strengths while fairness is generally expanded to all. Peterson & Seligman in Character Strengths and Virtues: A Handbook and Classification (2004) class humanity as one of six virtues that are consistent across all cultures.
The concept goes back to the development of "humane" or "humanist" philosophy during the Renaissance (with predecessors in 13th-century scholasticism stressing a concept of basic human dignity inspired by Aristotelianism) and the concept of humanitarianism in the early modern period, and resulted in modern notions such as "human rights".
Confucius said that humanity, or “Ren”(仁), is a “love of people” stating “if you want to make a stand, help others make a stand.” That is, the Confucian theory of humanity exemplifies the golden rule. It is so central to Confucian thought that it appears 58 times in the Analects. Similar to the Christian process of seeking God, Confucius teaches seeking Ren to a point of seemingly divine mastery until you are equal to, or better than, your teacher. The Confucian concept of Ren encompasses both love and altruism.
Plato and Aristotle both wrote extensively on the subject of virtues, though neither ever wrote on humanity as a virtue, despite highly valuing love and kindness, two of the strengths of humanity. Plato and Aristotle considered "courage, justice, temperance" and "generosity, wit, friendliness, truthfulness, magnificence, and greatness of soul" to be the sole virtues, respectively.