“It was that obedience [of Christ], brought to its consummate fruition on the cross, that constituted him an all-sufficient and perfect Saviour.” ~ John Murray, Redemption Accomplished and Applied (Eerdmans, 1955), p.23.
Murray here is commenting on Hebrews 2:10-18 & 5:8-9. Jesus was not “perfected” through His suffering (Heb 2:10) in the sense that He had sin that had to be dealt with, or in the sense that He was impure in any way. He did not “learn obedience” in the sense that at one time previously He was disobedient having not yet been taught to obey. When the Bible says He was “perfected” and “learned” it means that as His life moved along, leading Him eventually to the cross, every day brought with it more from God the Father that Jesus needed to obey.
When He was five years old, His obedience was flawless. When He was 15 years old, His obedience was flawless (imagine!). When He was 25 years old, His obedience was flawless. But it was not until one day in His 34th year, as He uttered the words, “Father, into your hands I commit my spirit!” (Luke 23:46), that Jesus’ obedience was finally completed. The act of giving up His spirit in death was the final step of obedience for the incarnate Son of God. His “learning” of obedience was not finished until, with the last “lesson” He could say, “It is finished!” (John 19:30).
It is this “finished” and “perfected” obedience that Christ accomplished which became the perfect righteousness that God credits to every believer through faith:
“Out of the anguish of his soul he shall see and be satisfied; by his knowledge shall the righteous one, my servant, make many to be accounted righteous, and he shall bear their iniquities.” (Isaiah 53:11)
… for all have sinned and fall short of the glory of God, and are justified by his grace as a gift, through the redemption that is in Christ Jesus, whom God put forward as a propitiation by his blood, to be received by faith. This was to show God’s righteousness, because in his divine forbearance he had passed over former sins. It was to show his righteousness at the present time, so that he might be just and the justifier of the one who has faith in Jesus. (Romans 3:23-26)