The Ten Commandments were not given to Adam, or his immediate children; not to Abraham; not to Joseph the prime minister of Egypt. The first laws were given to Moses, hundreds of years after Adam…why?
Now, Israel, hear the decrees and laws I am about to teach you. Follow them so that you may live and may go in and take possession of the land the Lord, the God of your ancestors, is giving you. Do not add to what I command you and do not subtract from it, but keep the commands of the Lord your God that I give you (Deuteronomy 4:1-2).
The laws were given because the people would not follow God with their hearts. So God gave laws as a last resort to help the people to reflect on the laws and understand the condition their hearts are to be in.
The law was given to help the people understand ungodly and unholy behaviours. Enabling them and us to choose to be Holy as our Father in heaven and give life to all and everything around us.
Jesus came fulfil the law and we are again in a heart relationship with the Almighty God. Being led by His Holy Spirit; so that the word is fulfilled – I will write my laws on their hearts.