In both the Nicomachean Ethics and the Politics, Aristotle says that the role of law in society is to uphold the principles of justice and inculcate virtue in the citizens. However, he points out that the law will only do this if the society in which it operates is just: unjust societies will have unjust laws.
Aristotle also regards virtue as a matter of character. A virtuous man is someone who understands the right course of action in any given situation and is naturally disposed to take this course. An individual cannot, therefore, be coerced into true virtue, however good their conduct. However, a just society can be governed by laws that reflect the qualities of a wise and virtuous lawgiver. The society in which such laws prevail will be more harmonious and more conducive to virtue than a society with unjust laws, even though the characters of individuals who are not inclined to virtue remain unaltered.