Ethics is the branch of philosophy that examines right and wrong moral behavior, moral concepts (such as justice, virtue, duty) and moral language. Various ethical theories pose various answers to the question "What is the greatest good?" and elaborate a complete set of proper behaviors for individuals and groups. Ethical theories are closely related to forms of life in various social orders.
The epic poems that stand at the beginning of many world literatures, such as the Mesopotamian Epic of Gilgamesh, Homer's Iliad and the Icelandic Eddas, portray a set of values that suit the strong leader of a small tribe. Valour and success are the principal qualities of a hero, and are generally not constrained by moral considerations. Revenge and vendetta are appropriate activities for heroes. The gods that appear in such epics are not defenders of moral values but are capricious forces of nature, and are to be feared and propitiated.
More strictly ethical claims are found occasionally in the literature of ancient civilizations that is aimed at lower classes of society. The Sumerian Farmer's Almanac and the Egyptian Instruction of Amenhotep both advise farmers to leave some grain for poor gleaners, and promise favours from the gods for doing so. A number of ancient religions and ethical thinkers also put forward some version of the golden rule, at least in its negative version: do not do to others what you do not want done to yourself.
Since the origin of Ethical Monotheism in (Hebrew) Judaism, something Greek-sounding like "ethics" may be said to have been originated in Judaism's up to four thousand years old passed down traditions and instructions of the Torahs (Hebrew: //, toroth; plural of Torah), Oral, Written, and Mystical.
Socrates, as portrayed in Plato's Republic, articulates the greatest good as the transcendent "form of good itself". The good, Socrates says, is like the sun. The sun gives light and life to the earth, the good gives knowledge and virtue to the intelligible world. It is the cause of goodness in people and actions, and it also is the cause of existence and knowledge. The pursuit of and love of the good itself (rather than any particular good thing) Socrates thought was the chief aim of education and (especially) of philosophy.
In his personal life, Socrates lived extremely morally. He was chaste, disciplined, pious, responsible, and cared for his friends In Gorgias he defends the notion that it is better to suffer injustice than to do it. The Greeks found this paradoxical, but Socrates both argued and lived this philosophy consistently. That is because the doing of evil damages the soul, which is the highest part of humans. In the Republic, Socrates is challenged to defend the view that we have reasons to be moral that do not come from rational self-interest, in response to Glaucon's arguments in Book 2. The Republic develops the view that being a good person in an ethical sense involves achieving internal harmony of the parts of the soul. However, Plato's ethical ideal, as expressed in the Republic, still has much in common with the Homeric conception of the leader of a tribe or city: the successful running of the city and the internal harmony of the citizen who runs it is the main ethical aim, and there is little mention in Plato of any strictly moral obligations the ruler may be under.
Aristotle's ethics builds upon Plato's with important variations. Aristotle's highest good was not the good itself but goodness embodied in a flourishing human life. His ethics are based on eudaimonia, variously translated as "happiness," "prosperity," "flourishing," or "success." A "great-souled" citizen who lives a life of virtue can expect to achieve eudaimonia, which Aristotle argues is the highest good for man. Following Plato, Aristotle gives a significant role in moral life the virtues, fixed habits of behavior that lead to good outcomes; the main virtues are courage, justice, prudence and temperance. The highest form of life is, however, purely intellectual activity.
Later Greek schools of philosophy, such as the Epicureans and Stoics, debated the conditions of the good life. Epicurus taught that the greatest good was pleasure and freedom from pain. The Epicureans emphasized the quiet enjoyment of pleasures, especially mental pleasure, free of fear and anxiety. The Stoics thought the greatest good not pleasure but reason and everything in accord with reason, even if painful. Hence they praised the life of reason lived in accordance with nature.
A theme of Ancient Greek ethics then is the role of the virtuous life in achieving eudaimonia, or the good life; and Aristotle, Epicurus and the Stoics all argued that virtue was necessary for happiness, albeit in different ways and with different conceptions of those terms.
A passage of the Torah, "Love your neighbour as yourself" was taken up by the writers of the New Testament and made part of the theological centerpiece of the Christian ethical stance. In the New Testament Jesus teaches that all the commandments of Jewish religious law could be summarized in the two rules, "Love God and love your neighbour" (Mark 12:28-31). This is illustrated with the Parable of the Good Samaritan, which praises action to help any human in need.
In the Middle Ages, Thomas Aquinas developed a synthesis of Biblical and Aristotelian ethics called natural law theory, according to which the nature of humans determines what is right and wrong. For example, murder is wrong because life is essential to humans so depriving someone of it is inherently an evil. Education is needed for humans, and is their right, because their intellectual nature requires developing. Natural law theory remains at the heart of Catholic moral teaching, for example in its positions on contraception and other controversial moral issues.
The Catholic practice of compulsory confession led to the development of manuals of casuistry, the application of ethical principles to detailed cases of conscience, such as the conditions of a just war.
Immanuel Kant, in the 18th century, argued that right and wrong are founded on duty, which issues a Categorical Imperative to us, a command that, of its nature, ought to be obeyed. An action is only truly moral if done from a sense of duty, and the most valuable thing is a human will that has decided to act rightly. To decide what duty requires, Kant proposes the principle of universalizability: correct moral rules are those everyone could adopt.
Kant's philosophy marks a number of important conceptual shifts in philosophical thinking about ethics. Kant argues that questions about happiness should not be a focus in ethical thought, because ethics should be universal while happiness may involve very different modes of life for different individuals. He also believed this approach was necessary if an ethical theory was to avoid becoming 'heteronomous'; that is, locating the source of proper moral motivation outside of properly moral concerns.
In 19th century Britain, Jeremy Bentham and John Stuart Mill advocated utilitarianism, the view that right actions are those that are likely to result in the greatest happiness of the greatest number. Utilitarianism remains popular in the twenty-first century.
Both Kantianism and Utilitarianism provide ethical theories that can support contemporary liberal political developments, and associated enlightenment ways of conceiving of the individual.
The early twentieth century saw many debates on metaethics, that is, philosophical theory on the nature of ethics. Views ranged from moral realism, which holds that moral truths are about mind-independent realities, to evolutionary ethics, which believes ethical practices are merely evolved ways of behavior that led to evolutionary success, to the error theory of J. L. Mackie, which held that the entire notion of ethical obligation is a mistake.
Reflections on the Holocaust, such as those of Hannah Arendt, led to a deepening appreciation of the reality of extreme evil. The Holocaust impacted other Jewish philosophers immensely, for instance, the post-war period saw Emmanuel Levinas develop his 'ethics of the other' and situate ethics as 'first philosophy'. This philosophy showed a focus on the relation to the other in distress as central to the development of ethics and placed ethical theories center-stage in philosophy. Also in reaction to the Holocaust, rights theories, as expressed for example in the 1948 Universal Declaration of Human Rights, asserted the inalienable moral rights of humans to life, education, and other basic goods. Another response to the atrocities of World War II included existential reflections on the meaning of life, leading to approaches to ethics based on "the situation" and personal interaction.
In the late 20th century, there was a so-called 'aretaic turn' and renewed interest in virtue ethics. This turn is often traced to a paper by G.E.M. Anscombe entitled "Modern Moral Philosophy". This approach was then furthered and popularized by figures such as Philippa Foot, Alasdair MacIntyre, as well as Paul Ricoeur. The revival of this ethical position congruently saw a return to engagement with earlier philosophers associated with moral philosophy such as Thomas Aquinas  and Aristotle 
The 1970s also saw a revival of casuistry in the form of applied ethics, the consideration of detailed practical cases in bioethics, business ethics, environmental ethics and other such special fields. The development of new medical technologies such as IVF and stem cell research produced many new issues requiring ethical debate.