The reference is to the Bible and the story presented therein that God gave Moses the Ten Commandments carved by His finger on tables of stone. Being God's orders, they were intended to be eternal and unchanging. As a result, when we say something is "set in stone", we mean that it, too, is forever unalterable.