John Gill's Exposition of the Whole Bible
Psalms 106:23
Therefore he said that he would destroy them,.... He said in his word, the Targum adds; he thought within himself he would; he seemed determined in his own mind to destroy them, being provoked at their wretched forgetfulness of him, and their idolatry; he said to Moses,
let me alone, that my wrath may wax hot against them, and that I may consume them, Exodus 32:10. The decree indeed was not gone forth, but there was such an appearance of displeasure as if ruin was determined; and a great number was destroyed, and the whole body was threatened.
Had not Moses his chosen stood before him in the breach; made between God and the Israelites by their sin; the allusion is either to an hedge broken down, at which a spoiler enters, unless made up, Ezekiel 22:30, or to a breach made in the wall of a besieged city, at which the besieger enters, unless stopped by the besieged, Isaiah 30:13, or to the bank or dam of a river broken down, which lets in a flood of waters, 2 Samuel 5:20. So Moses made up the hedge, and stood in the gap; he presented himself to God, rushing in like a man of war, and pouring out his wrath like an inundation of waters: this is to be understood of his fervent and importunate prayer to God on the behalf of this people, and which succeeded.
To turn away his wrath, lest he should destroy them;
Exodus 32:11 so the Targum,
"unless Moses his chosen had rose up and strengthened, or prevailed in his prayer before him to turn away his wrath from destroying.''
This shows the power and efficacy of prayer, and of what avail it is with God, especially the prayer of his elect; it was Moses, his chosen, that prayed, a choice servant of his; and whom he had chosen to everlasting life, as well as to be the deliverer, guide, and governor of Israel; see Luke 18:7. Herein he was an eminent type of Christ, as in other things; as Moses was a mediator between God and the people of Israel, so is Christ between God and his people. Sin is a transgression of God's law, a breaking of his statutes, which he has set as an hedge, fence, or wall, about man; and this has made a breach between God and man; which lets in the wrath of God as a flood, and justice as an armed man: and terrible it is to consider there is no standing before him, and making up the breach; but Christ has interposed as a surety, made satisfaction to law and justice, and procured peace and reconciliation; and so, by his atonement and intercession, has made up the breach, appeased the wrath of God, and turned it away, and prevented the ruin and destruction of his people.