What is meant by “a law unto themselves”?

Question:

What does this part of Romans 2:14 mean? I highlighted the part I don’t understand.

Romans 2:14 KJV "For when the Gentiles, which have not the law, do by nature the things contained in the law, these, having not the law, are a law unto themselves."

Answer:

"For when Gentiles who do not have the Law do instinctively the things of the Law, these, not having the Law, are a law to themselves, in that they show the work of the Law written in their hearts, their conscience bearing witness and their thoughts alternately accusing or else defending them" (Romans 2:14-15).

Paul stated, "For there is no partiality with God" (Romans 2:11). Because of this, everyone who sins will be condemned, whether they had access to a codified law or not (Romans 2:12). It isn't knowledge of the law that is the critical matter, but whether a person does what the law commands (Romans 2:13).

Paul proved that the Gentiles have sinned (Romans 1:18-32), but someone might claim that God's condemnation of them is unfair. After all, they didn't have anything telling them that what they were doing was wrong.

However, an important point is being overlooked: Morality doesn’t come from law. In other words, the law doesn't determine what is right or wrong. The law only defines what is right and wrong. It doesn't make an action right or wrong; it simply states what already exists in clear terms. For example, in science, we have a law of gravity. Now, gravity existed long before Newton came up with the law of gravity. The law of gravity defines how gravity operates, but it did not create gravity. Murder is wrong. The law only explains that murder is a sin. The law did not make murder into a sin. Unlike man’s laws, which are sometimes arbitrary and inaccurate, God’s law accurately defines what exists. It is the truth (Psalms 119:142).

Having a written law is an advantage (Romans 3:1-2), but it isn't an absolute requirement for knowing that some things are right and some are wrong. For example, it is universally seen as wrong to kill another person without justifiable reason, honesty is considered more noble than lying, and marriage between a man and a woman is to be respected. Different societies will make exceptions, but a basic understanding of right and wrong is present. Thus, as soon as a person makes a moral judgment that is in agreement with God’s law, he shows sufficient understanding to be accountable. If someone says it is wrong to steal my food, then he understands that stealing is wrong and condemns himself if he steals money from someone else.

While the Gentiles' knowledge of morality would not be complete, there would be enough there to judge their actions against what they understood, their understanding either excusing them or accusing them. This is why the Greeks felt guilty over some of their actions. Their conscience bothered them when they went against what they knew to be wrong. In other words, even though they didn't have a document containing the laws of God, their understanding becomes equivalent to a law. This is what is meant by saying that they "are a law to themselves."

Paul already showed that the Greeks had sufficient knowledge to know God existed (Romans 1:18-23). Therefore, they stood condemned by their own knowledge for idolatry. Even adding just what a person instinctively knows, no one keeps his understanding perfectly. All stand condemned before God.