Joshua 24:10

But I would not hearken unto Balaam; therefore he blessed you still: so I delivered you out of his hand.

This verse belongs to Joshua's closing work as he was laying down his leadership and facing death, when he gathered the tribes together to recount their history since they were called out as God's people. That final gathering took place at Shechem for the people to renew their vows in the presence of their dying leader. The place was marked by sacred associations with the covenant with Abraham and Jacob and with Israel's own vows on entering Canaan, with Mount Ebal and Mount Gerizim standing as silent witnesses.

In assembling the host and recapitulating the wilderness travels and past experience of trials, failures and warnings, Joshua was following the example of Moses just before his death. This rehearsing of God's instruction again and again is a pattern to be followed today. The historical background recalled in the verse is that the king of Moab warred against Israel and summoned Balaam to curse them, with Balaam desiring and attempting to do harm by cursing.

God would not listen to or heed Balaam, but caused him to continue blessing Israel instead. So He delivered Israel from Balaam's hand and power and from the danger posed through Moab's king. Joshua recalled this deliverance along with other acts such as giving Israel land they had not worked, cities they had not built, and vineyards and olive groves they had not planted, as evidence of what God had accomplished for them. These were evidences of His love, mercy and providential care, meant to awaken gratitude and humility over murmuring and disobedience and to strengthen faith by reminding the people of His power on their behalf.

The wider passage surrounding the verse warns against idolatry and close association with idolaters, including intermarriage, because such ties corrupt and lead to sin and ruin. It shows God as faithful both to fulfill promises and to carry out warnings. That warning is to be taken personally.