Now before faith came, we were held captive under the law, imprisoned until the coming faith would be revealed. So then, the law was our guardian until Christ came, in order that we might be justified by faith. But now that faith has come, we are no longer under a guardian, for in Christ Jesus you are all sons of God, through faith. For as many of you as were baptized into Christ haveput on Christ. There is neither Jew nor Greek, there is neither slave nor free, there is no male and female, for you are all one in Christ Jesus. And if you are Christ's, then you are Abraham's offspring, heirs according to promise.
Prior to the coming and teaching of Jesus, things were different. Until his coming, the way of God had not been fully revealed. The only knowledge we had of God was from the law, and the glimpses of grace that were provided along the way.
One such glimpse is David, that murdering, adulterous, man after God's own heart. How can the Bible call a man like David a man after God's own heart? Sure, he did some great things, he wrote some incredible Psalms, he stood up to Goliath, but he also did some things that we on the other end of the spectrum as well. So how can the Bible call him a man after God's own heart? Grace.
Another glimpse is Moses. He did some incredible stuff as well. But he was a reluctant hero, telling God that he should choose his brother because he was a better speaker. And he was not able to enter the promised land because of his disobedience. Yet there he is in the Hall of Faith (Hebrews 11). More grace in action.
The law was our keeper, a protector until Christ came and revealed obedience through faith. People often did not want to keep the law, but did so out of fear of God. It protected them even when they did not like it or could not understand it. But now, it is our faith that protects us. Externally, it may look similar. We still don't murder. Grace can still cover that, but faith does not lead us to be murders. Or adulterers. Or even little white liars.
Once the law led us, now faith does. The law could not redeem us, but faith can. Faith can because it comes from a pledge of a good conscience toward God. Even in faith, we are not perfect, but as heirs, the inheritance is given based on God's promise, and not our obedience. What a relief!