In Bereishis (32:11) the posuk tells us that Yaakov was worried that he was too small in stature to receive the kindness of Hashem. The gemara in Taanis (20b) says we learn from the above posuk that a person is forbidden to stand in a place of danger and rely on a miracle since it is possible that Hashem will not perform a miracle. Even if Hashem will perform a miracle he will have some of his zechuyos deducted.
A question arises based on the Rema in Orach Chaim (187,188) discussing the fact that on Chanukah we say Al Hanisim in Birkas Hamazon. There is a special horachaman to say if a person forgot to say Al Hanisim. This horachaman is asking for a neis to happen as it happened during the time of neis Chanukah. How could you ask for a neis?
We can elaborate upon this question based on the gemara in Berachos (60) that discusses a person davening for the gender of his unborn child. A person may not daven that his wife should have a boy if she is more than forty days into her pregnancy since it is a tefillas shav. The gemara asks, don’t we see that Leah davened that her baby should be a girl and it turned into Dinah? The gemara answers that this was al yedei neis and we don’t bring proof from miracles. We see from the gemara that davening for a neis is a tefillas shav, otherwise you would be allowed to daven for a miracle that the baby should turn into a boy.
One answer could be that a private person is not allowed to daven for a miracle because who says that the person davening for a miracle is worthy of a miracle happening to him. However, one may daven for a neis for a rabbim or a tzibbur, hence the language used in the horachaman is plural; the word lanu is used. This could also be the reason why they were allowed to benefit from neiros Chanukah where normally we are not allowed to have hana’ah from ma’aseh nissim. Since it took place for the rabbim, one is allowed to have benefit from the neiros.
Another tirutz could be that one may not daven for a neis that happens in private, like in the case of switching the gender of a baby. However, in the case where the neis happens in front of Klal Yisroel and everybody witnesses it and knows that it happened from Hashem, then there is a tremendous Kiddush Hashem. Not only does the person not lose zechyos, he gets another zechus added of Kiddush Hashem. We daven that the miracle of Chanukah should happen again in our days, with the addition of kovod Shomayim.
We can say a third tirutz that the war of the Chashmonaim seemed to be b’derech hateva. It was a regular war that was won. Such a neis can not be davened for since the neis is not that obvious. In the case of a miracle that has to take place and it can only be explained as a miracle and not b’derech hateva, one can not daven for.
Another tirutz can be said in reference to the famous story of Rabi Chanina Ben Dosa. When Rabi Chanina’s wife did not have oil to light her wicks, he said, “The one who said oil should burn can make vinegar burn.” The reason he was allowed to do that was because he recognized that the whole teva in and of itself is a miracle. If everything is considered a miracle, then one may daven for a miracle. During the time of Chanukah and Purim where Klal Yisroel is on the madreigah of recognizing that even teva is a neis, one is allowed to daven for a neis.
May we all be zocheh to recognize teva and neis the right way!