"And this is the law of the sacrifice of peace offerings" (Leviticus 7:11). This is what Scripture says: "Her ways are ways of pleasantness, and all her paths are peace" (Proverbs 3:17). Everything that is written in the Torah is written for the sake of peace. Even though wars are written in the Torah, they were written for the sake of peace. You find that the Holy One, blessed be He, annulled the decree for the sake of peace. When? When the Holy One, blessed be He, said to Moses, "When you besiege a city for many days," and so forth (Deuteronomy 20:19), and that entire matter, the Holy One, blessed be He, told him that he should utterly destroy them, as it is said, "for you shall utterly destroy them" (ibid. 20:17). But Moses did not do so. Rather he said: Now I am going and striking; I do not know who has sinned and who has not sinned. Instead, in peace I will come upon them, as it is said, "And I sent messengers from the wilderness of Kedemoth, [with words of peace, saying]" (ibid. 2:26). When he saw that he did not come in peace, he struck him, as it is said, "And they struck him, and his sons, and all his people" (Numbers 21:35). The Holy One, blessed be He, said to him: I said, "for you shall utterly destroy them," and so forth, yet you came upon them in peace. By your life, just as you said, so will I do, as it is said, "When you draw near to a city to fight against it, then proclaim peace to it" (Deuteronomy 20:10). Therefore it is said, "Her ways are ways of pleasantness, and all her paths are peace" (Proverbs 3:17).
Moses Offers Peace to Sihon and the Torah's Ways of Peace
Midrash Tanchuma Buber, Tzav 5:1
וזאת תורת זבח השלמים (ויקרא ז יא). זש"ה דרכיה דרכי נועם וכל נתיבותי שלום (משלי ג יז), כל מה שכתוב בתורה, (לשון) [לשום] שלום הוא נכתב, אעפ"י שכתוב בתורה מלחמות, לשם שלום נכתבו, את מוצא שביטל הקב"ה את הגזירה מפני השלום, אימתי כשאמר הקב"ה למשה כי תצור (על) [אל] עיר ימים רבים וגו' (דברים כ יט), וכל אותו הענין, א"ל הקב"ה שיהא מחרים אותם, שנאמר כי החרם תחרימם (שם שם יז), ומשה לא עשה כן, אלא אמר עכשיו אני הולך ומכה, איני יודע מי חטא ומי לא חטא, אלא בשלום אבא עליהם, שנאמר ואשלח מלאכים ממדבר קדמות וגו' [דברי שלום לאמר] (שם ב כו), כיון שראה שלא בא בשלום הכה אותו, שנאמר ויכו אותו ואת בניו ואת כל עמו (במדבר כא לה), אמר לו הקב"ה אני אמרתי כי החרם תחרימם וגו', ואת באתה עליהם בשלום, חייך כשם שאמרת כך אני אעשה, שנאמר כי תקרב אל עיר להלחם עליה וקראת אלה לשלום (דברים כ י), לכך נאמר דרכיה דרכי נועם וכל נתיבותיה שלום (משלי יג יז).