In ancient society, law and morality were not distinguishable. But with the growth in the political organization law started forming a character different from morality. Law and morality today are different in terms of the scope of content.
Law affects a part of the human life and it does not affect the motives and thoughts of a man. There is no matter of conscious here. Morality instead focuses on the entire life of the man. Acts which are not illegal could also be regarded to be immoral.
Meanness and ingratitude are not illegal but these are immoral. If an act does not cause any injury to someone else then it is not illegal.
So suppose you are riding a bike without switching on the light then this is illegal but not immoral. The rules of the laws have a list that is illegal but may not necessarily be immoral. The domain of law is not as wide as the domain of morality and law to be able to be the same as morality is not likely to succeed.
Read some good life quotes to differentiate between law and morality.
Law is something that is state enforced on you and it leads to fine and imprisonment or both. The sanction that goes behind the law is that it affects your physical bring. But when it comes to morality it is about your internal consciousness. The actions that you take morally are your own choice and you are free to take them,
There is no physical punishment involved when you deal with morality. But it could lead to you being boycotted socially. Law thus is a force on you but morality is something that cannot be forced on you. The ethical appeal is based on what is in one’s individual sense and what he thinks is good or evil.