What does Psalm 40:5 mean?
David speaks not only on his own behalf but also on behalf of the people of Israel in this verse by declaring that the Lord had given them many, many signs of His power and love for them. Many of these events are seen in the dramatic events of the Exodus (Exodus 7:3; Deuteronomy 6:20–25; Jeremiah 32:21–23).God worked in wondrous ways to preserve David when his enemies pursued him just as He protected and provided for the Israelites during their wilderness wanderings. He had given them shoes that did not wear out (Deuteronomy 29:5). He had provided water from a rock for them (Exodus 17:6). He had kept them safe from warlike tribes (Exodus 17:13; Numbers 21:21–24). He had fed them with manna and quail (Exodus 16:9–16, 31).
The Lord's thoughts toward David and the people of Israel included His plans for them. He was their provider and protector in the past and He would remain so in the future. David would proclaim the Lord's wondrous deeds and thoughts, but he acknowledged that they were "more than can be told" (John 20:30–31; 21:25).