Defending David and keeping him safe is spoken of as upholding or supporting him. AT: "who defends me" or "who keeps me safe" (See: [[rc://en/ta/man/translate/figs-metaphor]])
Punishment is spoken as if it were payment. AT: "He will do the evil to my enemies that they have done to me" or "He will cause the evil that my enemies have done to me to be done to them" (See: [[rc://en/ta/man/translate/figs-metaphor]])