In Al Hannisim we say:
v'al hamilchamot she-asita la-avoteinu Loosely translated: And for the wars which you made for our Forefathers
Why are we thanking Hashem for wars?
R' Yaakov Emden (Luach Eresh, sec. 177) writes:
כי הנה אחד מתארי השי"ת שהוא איש מלחמה, ויתכן להודות ולשבח לשמו עליהם, שהוצרכנו להם אחר שגרם העון והחרב באה, ובזכות הרחמים נצלנו (?) ממנה, כי ה' הוא הנלחם, חייבין אנו לתת הודאה עליהם בלי שום ספק
"One of Hashem's titles is 'the Master of War.' So it is logical to thank and praise His name for them, that we needed [war] after sin caused the sword to come, and in the merit of [Hashem's] mercy we were saved [I'm not certain about this word] from it, for Hashem is the One who fought. So we are undoubtedly obligated to thank Hashem for them [the wars]."
That said, there are versions of the Siddur (including R' Shneur Zalman of Liadi's) that don't have this phrase. In one of his letters, the Lubavitcher Rebbe zt"l provides possible rationales for this.