We can assume that Joab heard about the movements of Abner’s troops and decided to intercept them at Gibeon. In doing so he would leave the territory of Judah and go into the territory of Benjamin. Crossing the borders is an act of aggression on his part and no longer a defence move only. It is likely that he acted on his own initiative without direct authorization from David. Indeed, the author seems to make it clear that David is absent from all the events that take place on this day.1
13 Joab, fils de Tseruja, et les gens de David, se mirent aussi en marche. Ils se rencontrèrent près de l'étang de Gabaon, et ils s'arrêtèrent les uns en deçà de l'étang, et les autres au-delà.