ואחרו [וְאַחֲרָ֛יו] אֶלְעָזָ֥ר בֶּן־דדי [דֹּד֖וֹ] בֶּן־אֲחֹחִ֑י בִּשְׁלֹשָׁ֨ה גברים [הַגִּבֹּרִ֜ים] עִם־דָּוִ֗ד בְּחָֽרְפָ֤ם בַּפְּלִשְׁתִּים נֶאֶסְפוּ־שָׁ֣ם לַמִּלְחָמָ֔ה וַֽיַּעֲל֖וּ אִ֥ישׁ יִשְׂרָאֵֽל׃
And after him was Eleazar the son of Dodo the son of an Ahohite, one of the three mighty men with David, when they jeoparded their lives against the Philistines that were there gathered together to battle, and the men of Israel were gone away;
Rashi
and the Philistines gathered there for war they were eager to avenge themselves upon Israel and those mighty men who reviled them, as delineated in Samuel (II 23:9): “...when they reviled the Philistines.”