David knows that in his efforts, the Lord will back him up, for he is just toward the afflicted and the needy. David will first have said this sentence (Psalm 140:12) to himself, for he had to deal with mean enemies, and therefore he belonged to the afflicted.
But subsequently, it is also broader: others may also know this. For us it does not mean, in the life of everyday, that we get what we think we have a right to. It does say that God will be just and look after us, and in this way, this verse becomes reality (see also 2 Peter 3:13).
13 Je sais que l'Eternel fait droit au misérable,Justice aux indigents.