1 Vayikra Rabbah 26:2, cited by Rav Asher Weiss (TorahAnytime 258845)
אמר רבי אבא בר כהנא: דורו של דוד כולן צדיקים היו, ועל ידי שהיו להן דילטורין היו יוצאין במלחמה והיו נופלין. אבל דורו של אחאב עובדי עבודה זרה היו, ועל ידי שלא היה להן דילטוריא היו יורדין למלחמה ונוצחין.
Rabbi Abba bar Kahana said: David's generation were all righteous — but because there were דילטורין (informers, tale-bearers) among them, they went out to battle and fell. Ahab's generation were idol-worshippers — but because they had no informers among them, they went down to battle and were victorious.
Rav Asher Weiss, in a chizuk shiur delivered in the wake of the Simchat Torah 5784 attack (דברי חיזוק והתעוררות בעקבות הפיגוע בשמחת תורה התשפ"ד, 7 Oct 2023): "בשעת מלחמה צריך אחדות" — in wartime, what we need is unity; it is in our very souls. Citing the midrash (Vayikra Rabbah 26:2; parallel in Yerushalmi Peah 1:1, whose wording is quoted here), he stresses that David's generation were scholars and righteous, yet fell because there were אנשי ריב ומדון — men of quarrel and strife — among them, while Ahab's idolaters won because there were none. Unity is itself the weapon. Lecture: TorahAnytime 258845 @ 00:06:04. Listen: https://yutorah-rss.netlify.app/transcripts/#258845@00:06:04