God prepares Israel for His coming to Sinai. Separation and purity are essential to avoid death.
He speaks audibly the ten commandments, to show His power. The people are appropriately fearful and ask for a mediator. God speaks the rest of the law (through chapter 24) to Moses.
How this is about Jesus
Jesus is the end of the law (Romans 10:4). He speaks it again in the Sermon on the Mount.
In Christ, the boundaries keeping us from the holy God are taken down.
Sins this reveals
We break each of the 10 commandments in various ways, as we see in Matthew 5.