In the Old Testament, God made a covenant, or agreement, with the nation of Israel. That covenant was based on laws that God gave them. In the Bible, in the book of Exodus, we read how Moses prepared the people to receive the covenant God was making with them.
Standing before Mount Sinai, Moses took a basin of blood from an animal sacrifice, and with a branch of hysop, he sprinkled the blood on the people of Israel. As he did this, he said, "Behold, the blood of the covenant which the LORD has made with you." (Exodus 24:7-8)
A few chapters later, we read, "God said, `Behold, I am going to make a covenant.'" (Exodus 34:10) "Then the Lord said to Moses, `Write down these words, for in accordance with these words I have made a covenant with you and with Israel.' So he was there with the Lord forty days and forty nights; he did not eat bread or drink water. And he wrote on the tablets the words of the covenant, the Ten Commandments." (Exodus 34:27-28)
God gave Israel a land to live in, a temple in which to worship Him and a king to lead them. Yet Israel did not keep the covenant God made with them. God warned Israel what would happen if they turned from Him. He promised that their disobedience would bring the loss of their produce and live stock, their freedom and their land. (Deuteronomy 28:15-68) But Israel, as a whole did not believe Him, and turned from faith in Him.
Jeremiah wept as God's judgment fell on Israel. But God told him, "I will make a new covenant with the house of Israel and the house of Judah,... not like the covenant which I made with their fathers when I took them by the hand to bring them out of the land of Egypt, My covenant which they broke. This is the covenant I will make with them, I will put My law within them, and on their hearts will I write it... they shall all know Me, from the least of them to the greatest of them... for I will forgive their iniquity, and their sins I will remember no more. (Jeremiah 31:31-34)
God said this New Covenant would be different, not like the one which He made with their fathers. It would be an agreement based, not on man's effort, but on God's grace. It would be characterized by God forgiving their sins, writing His law upon their hearts [giving them a new nature] and each one of them individually knowing Him.