Earlier, David had defeated Edom. Joab, the commander of David’s army, went into Edom to bury the dead. While he was there, he killed all the males.