Law has two duties.
1. Its first duty is to teach and promulgate what is morally good.
2. Its second duty is to punish the evil doer.
The law's first duty as teacher may be seen in the Contemplation of Justice in front of the U.S. Supreme Court building in Washington, D.C. Here the seated lady is contemplating a figurine of Justice in her right hand. The figurine is blindfolded and holding a folded scale, indicating that justice should be applied without partiality (blindfolded) and should be applied in measure (scales) according to the measure of evil done. The book of law is under the lady's left arm, indicating that human law needs to be written and promulgated before its enforcement.
Before its enforcement, law must be promulgated by written code and teaching so the law is known and understood by the ruled.
So He declared to you His covenant which He commanded you to perform, that is, the Ten Commandments; and He wrote them on two tablets of stone. Deuteronomy 4: 13
Now this is the commandment, the statutes and the judgments which the LORD your God has commanded me to teach you, that you might do them in the land where you are going over to possess it. Deuteronomy 6: 1
For Ezra had devoted himself to the study and observance of the Law of the LORD, and to teaching its decrees and laws in Israel. Ezra 7:10
Wherefore, in order that a law obtain the binding force which is proper to a law, it must needs be applied to the men who have to be ruled by it. Such application is made by its being notified to them by promulgation. Wherefore promulgation is necessary for the law to obtain its force. Thomas Aquinas, Summa Theologica, 1st Part of 2nd Part, Question 90, Article 4, I answer that.
Regarding God's natural law, it is understood by reason, conscience, human biology, and scripture.
Humankind has an inherent knowledge and understanding of good and evil (the tree of the knowledge of good and evil Genesis 2:17).
The natural law is promulgated by the very fact that God instilled it into man's mind so as to be known by him naturally.