Here "the forest" is described as if it were alive and could act. "The sword" refers to David's soldiers who fought with swords. Alternate translation: "dangerous things in the forest killed more men than David's soldiers killed with their swords" (See: [[rc://en/ta/man/translate/figs-personification]] and [[rc://en/ta/man/translate/figs-metonymy]])