The difference between law and gospel is not the difference between works and faith. Works and faith are present in both law and gospel; the difference is the order.
Adam was created into a blessed state. He was in fellowship with God and had all of creation under him. He was never in a state of neutrality with God. God never called on him to earn favor with God; he had it already. What he was called to do was to obey God’s word in order to maintain that blessed state. This is the covenant of creation, or the covenant of works- not that Adam was called to earn something with God from a state of neutrality, but to maintain that blessed state into which he was created by his own efforts. In order to do that, he had to believe what God said. It was when Adam and Eve called into question the truthfulness of God’s word, when they even entertained the possibility that the devil raised, “Hath God really said?” that the fall happened. So faith and works were both necessary under the covenant of creation; Adam had to believe God’s word and then work in order to maintain the blessings God had given him. This Adam failed to do, of course, rebelling against God’s word and plunging himself into ruin.
Israel had the same covenant made with them at Sinai. God had shown them great grace, had saved them from Egypt, made them a nation and blessed them with His laws and testimonies. Now He called them to believe His word and obey His laws in order to maintain that blessed state, represented by the promised land. The law says, “He that does them shall live in them.” The difference with Israel was their state; now that the race was plunged into sin, it was impossible that they should succeed. While Adam had the ability to obey God, Israel did not. The purpose of God’s covenant with Israel was therefore different. It was to make “sin exceedingly sinful”, in other words, to show them their hopelessness and their need for a savior. It also had the purpose of separating them from other nations and keeping them together as the special people of God, so that the witness of God’s dealings with His people would be preserved until that savior came.
In other words, the law in Israel had the purpose of pointing them to another promise, the promise God made to Adam and Eve after the fall, and repeated to Abraham- the promise of a godly seed that would undo the damage that Satan had done, symbolically crushing the serpent’s head. This was the covenant of grace. The promise of the covenant of grace was that God would bestow the blessed state on His people and that it would not be dependent on their actions to maintain that state; rather, Christ would maintain that state for them. Faith is the link that God works in us to lay hold of that blessed state earned for us by Christ, and good works are the working out of that blessed state in our lives, the beginning of the delivery of all of God’s benefits to us. The righteousness of the law is that “He that does them shall live in them”, but the righteousness of the gospel is, “the just shall live by faith.”
So we must avoid the mistaken false dichotomy that the difference between the law and the gospel is the difference between works and faith. Works and faith are present in both. Law and gospel are two different covenants, two different ways that the end state is achieved. Under the law, the blessings God gives us are maintained by our own efforts, and ever since the fall all such efforts are doomed. But Christ fulfilled the law perfectly and earned all those blessings for Himself forever, and under the gospel, the covenant of grace, infallibly delivers those benefits, faith in God’s word and a life of righteous good works, to all those chosen by the Father.