Paul continues in Galatians 3 to skewer the false gospel of the Judaizers, when he points out that Abraham was counted righteous by God, not by keeping the law, but by faith in the promises of God.
How this must have scalded the false teachers! For they had their ethnic superiority, being children of Abraham, and suggesting that poor Gentile believers could never be in the "chosen line" of Abraham unless they obeyed the law.
Now Paul makes it plain: even Abraham wasn't righteous according to their method! Rather, he believed God, and God declared him Righteous!
The Faith of Abraham was in God's promises to him about his seed being a blessing to all nations, and his being the father of many nations.
In Romans 4, Paul works out the logic of all this in great detail - how a man is not justified by law, because man can only break the law. But those who trust God's promise to justify by grace are declared righteous, though they did not keep the law, for God refuses to impute their iniquity to them!
Genesis 22 describes how Abraham came to trust in God's promise of a sacrifice to come. That promise was displayed in the rescue of Isaac by the substitute lamb, but Abraham knew it went much further than that: one day, The Lamb would be provided, of his seed, by God, and in the mountain of the Lord!
Not only did Abraham believe God's promise of a Lamb, but he rejoiced to see the day of the Lord Jesus!
Paul thus throws the old testament Word of God in the faces of the Judaizers who persecuted the Galatian believers: Abraham was justified by faith in the promise, not by works.
It is a dash of cold water in the faces of legalists, but a joy for poor Gentiles!