Why did David compose this Mizmor?
Radak: Also this was when he was fleeing Sha'ul.
Malbim: It is said against his haters and pursuers.
Why did he say "Rivah Hashem Es Yerivai"?
Rashi: Quarrel with those who quarrel with me. Radak - the Yud [at the beginning of] Yerivai is extra, like the Yud in Yekum and Yevul. It means Merivai; it is To'ar (kind of person). We find like this - "v'Es Yerivech Anochi Ariv" (Yeshayah 49:25).
Malbim: Quarrel with them before they come to war.
What is the meaning of "Lecham Es Lochamai"?
Rashi: Both of these are expressions of war. Make war with those who make war with me! Radak - this repeats the first half of the verse in different words.
Malbim: [Quarrel with them before they come to war. If they already came to war,] You fight them!