V'lo chilisi es Bnei Yisrael b'kinasi... If not for Pinchas taking action, that would have been it -- end of the story, sof pasuk, full stop, G-d forbid. Jewish history would have ended a mere 40 years after we were freed from Egypt. How do you wrap your mind around such a pasuk? Is such a thing even conceivable? Just a few days ago on 17 Tamuz we read Moshe's plea for mercy after the cheit ha'eigel. There too, Hashem threatened to start again with a Bnei Yisrael 2.0, but Moshe davened, "zechor l'avadecha... asher nishbata lahem bach," and reminded Hashem of his promise to make Bnei Yisrael a great nation and give them Eretz Yisrael. Rashi explains "nishbata lahem BACH": G-d did not place his hand on a whatever to take an oath. G-d took an oath on Himself. Just like G-d is eternal and unchanging, so too, his promise is eternal and unchanging. There is no possibility of an end for Bnei Yisrael or a 2.0 So what does our parsha mean?
And what if Moshe had not davened, "zechor... asher nishbata lahem bach?" Would the promise be any less binding? Do you have to pray in order for G-d to fulfill his promise?
There is one circumstance that seems to allow for Hashem to break his promise. In parshas Vayeitzei Hashem promises Ya'akov Avinu that his will protect and sustain him in his travels. Ya'akov responds, "Im y'hiyeh Elokim imadi... v'nasan li lechem le'echol u'beged lilbosh," etc." It sounds like Ya'akov is uncertain whether Hashem will fulfill his promise, and he is davening for it to come true. Why the uncertainty? Chazal answer: shema yigrom ha'cheit. The simple pshat in that answer is that Ya'akov did not doubt G-d -- Ya'akov doubted himself. Ya'akov was worried that perhaps he would prove unworthy of G-d's blessing due to his sins, and if so, G-d would be off the hook and not have to keep his word.
R' Leibele Eiger, however, says a chiddush: G-d's word is a reality; his promise in unbreakable. It is going to come true no matter what. "Shema yigrom ha'cheit" doesn't mean that G-d has an out. "Shema yigrom ha'cheit" means that instead of the promise coming true m'meila, Hashem will have to intervene and cause the person to have a hisorerus to once again become worthy of the promise being fulfilled.
One of my favorite pieces in the Ishbitzer is his interpretation of "terem nikra'u v'ani e'eneh, od heim m'dabrim v'ani eshma." If G-d responds "terem nikra'u," before we even call out to him, them what's the "od heim m'dabrim...?" He responded already before our dibur!? The Ishbitzer answers that "terem nikra'u" means Hashem responds by giving us the hisorerus to pray and call to him. He gives is the inspiration we need! Then, once we start davening, he listens to our prayers.
R' Leibele Eiger is telling us that either we will be inspired and deserve G-d's promise, or he will inspire us and cause us to have a hisorerus and thereby deserve it. Either way, it will always come true.
Now we understand why sometimes there is a need for tefilah even though Hashem has made a promise. Tefilah is the hisorerus that Hashem awakens in the nation, or even in a single individual speaking up on the nation's behalf, that makes keeping the promise possible, that makes keeping the promise worth doing, even when all seems lost.
We have it all backwards, says R' Leibele Eiger. It's not that Pinchas took action, "heishiv es chamasi," and therefore, "v'lo chilisi es Bnei Yisrael b'kina'si," and if not for that, all would be lost. Rather, "v'lo chilisi es Bnei Yisrael," Hashem promised never to destroy us, and therefore, He inspired a Pinchas to take action, "heishiv es chamasi." Pinchas was a tool in Hashem's hands so that the promise could be kept.
(Because Hashem used him as a tool, he gets the reward of shalom. To me it seems a little difficult to get this to fit the Midrash of "b'din hu she'yitol secharo," but you have to say some explanation for that Midrash anyway.)
There will always be a Moshe in every generation, a Pinchas, a Ya'akov Avinu. There will always be someone to bring us back, to plead on our behalf, a tool Hashem uses to bring us inspiration so we are never completely lost.