Saul was on one side of the mountain. David and his men were on the other side of the same mountain. David was moving as quickly as possible to get away from Saul. But Saul and his soldiers were going around the mountain to cut them off and trap David and his men.
Joab saw that there were two army groups ready to fight against him. One group was in front of him and the other group was behind him. So Joab chose some of the best soldiers of Israel and sent them out to fight against the Aramean army.