(Read Exodus 31:18)
The law was written in tables of stone, to show how lasting it is: to denote likewise the hardness of our hearts; one might more easily write on stone, than write any thing good on our corrupt natural hearts. It was written with the finger of God; by his will and power. God only can write his law in the heart: he gives a heart of flesh; then, by his Spirit, which is the finger of God, writes his will in the heart, 2 Corinthians 3:3.
For a more detailed explanation select the link below.
Exodus 31 Bible Commentary – Matthew Henry (concise) (christianity.com)
Exodus 31:18
18 When he finished speaking with him on Mount Sinai, he gave Moses the two tablets of the covenant, stone tablets, written with God’s finger.