The phrase "law to themselves" is an idiom that means that these people naturally obey God's laws. Alternate translation: "have God's laws already inside them" (See: [[rc://en/ta/man/translate/figs-idiom]])
Here "the law" refers to the law of Moses." Alternate translation: "they do not actually have the laws that God gave to Moses" (See: [[rc://en/ta/man/translate/figs-explicit]])