What happened was that previously, when David’s army had conquered the Edom people-group, his army commander Joab had gone there to help bury the Israeli soldiers who had been killed in the battle. Joab and his army remained in the Edom area for six months, and during that time they killed all the males of that area.