It is interesting to note that the historical occurrence to which the prelude alludes was actually one of David’s greatests conquests. When Joab destroyed all the males of Edom it was also the time that David had one of his greatest victories. You can read that in II Samuel 8:13. But you would never know that when you read through the Psalm. It seems more like a cry for relief and help in the midst of battling against foes than it does a time when victory is coming soon.
The Psalm begins with a lament that God has basically taken the other side. The complaint is that God has broken them and made his people suffer. It really isn’t what I would expect from the historical situation of the time. Verses 9-12 are curious because it seems that the author is doubting whether God is really going to rally with them. There are questions as to whether God has rejected them or if God is still going out with them on the battlefield. The author states that human help is worthless. I believe Gideon proved that point. The number of people you have is not significant if God is not with you.
Finally, the last verse we see a glimmer of the old David who trusted that no matter what, God would never leave or forsake him. We read that it is with God that we can win, God will win the battle for us. It does sound like a psalm of defeat as the author is getting ready for another battle after a thrashing. I guess the practical application is that we need to see God still on our side even after a thrashing, whatever that thrashing may look like. We should always be confident that with God we shall do valiantly.