In many ethics classes, one of the early lessons is distinguishing between ethics and law. Ethics are the moral principles that guide decisions based on values, commitments, and purposes. Laws, by contrast, are formal rules enforced by social institutions to regulate behavior. Ethics and law frequently overlap: most people recognize that stealing is (almost always) ethically wrong, and it is also illegal. There are, of course, exceptions often discussed in ethics courses, such as the classic dilemma of stealing for a morally compelling purpose (e.g., to feed the poor).
Zimmer et al. (Wed,) studied this question.