Here I am going to share some thoughts of mine on how ethics and laws are related, as well as the differences between these two.
What is ethics?
Ethics, also described as moral philosophy, is a system of moral principles which is concerned with what is good for individuals and society. 
What is law?
Law is a system of rules and guidelines which are enforced through social institutions to govern behavior.
Similarities between ethics and laws:
In general, laws are made based on moral values of a particular society. They describe the basic behavior of human beings. In another word, laws represent the minimum standards of human behaviors, that is, ethical behavior.  Besides, both laws and ethics are systems which maintain a set of moral values and prevent people from violating them. They both provide people guidelines of what may do or what may not do in certain situations. In a word, they exist in a purpose of making people benefit from being members of a well-regulated society.
Differences between ethics and laws:
However, there are many distinctions between ethics and laws. Firstly, ethics comes from people’s awareness of what is right and what is wrong while laws are written and approved by governments.  It means that ethics may vary from people to people because different people may have different opinions on a certain issue, but laws describe clearly what is illegal no matter how people arguing. To some extent, ethics is not well defined but laws are defined and precise. Ethics can also be distinguished by looking at whether people are being punished after they violate the rules. Nobody will be punished when they violate ethics; but whoever violates laws is going to receive punishment carried out by relevant authorities. Besides, an action can be illegal, but morally right. For example, in ancient China, some people rob properties from rich people, and give it to poor people, and it is considered to be morally right but be illegal. Similarly, an action that is legal can be morally wrong. For instance, some people spend thousands of dollars on their pets while some poor people on the street can not have enough food. Moreover, some laws are nothing to do with ethics, like cars should go on the left side of roads. Lastly, ethics emphasizes more on positive aspects while laws are more concerned with negative actions.
In Conclusion, ethics and laws and closely related since laws represent minimum ethical behaviors of human beings; but they are distinct from many aspects. Ethics provides people guidelines on how to behavior in order to create a peaceful society; but laws carry out restrictions through punishment. Sometimes ethics and laws do not necessarily have any overlap, but these two combined define how people should behavior in the society.