Maharal asks why Rashi needed to pinpoint this particular zechus as the one which elicited Hashem granting her a chuld. Rachel was a tzadekes – surely there were many acts of goodness and mitzvos which she did over the years that counted in her favor.
We see an important idea here: sometimes you can have Torah, tefilah, tzedakah, etc., but sometimes only a particular type of zechus can trigger midah k'neged midah the needed response.
Mahral explains that because Rachel could not tolerate the embarrassment of her sister Leah, Hashem responded in kind and no longer tolerated Rachel suffering the embarrassment of being barren. Rachel of course had many other zechuyos, but only giving the simanim had the quality necessary to produce midah k'neged midah this result.
I would like to suggest a slightly different twist based on the Ksav Sofer’s explanation of what I found to be one of the more difficult parts of the parsha. Earlier (30:1-2) the Torah tells us that Rachel in frustration came to Ya’akov and asked him to daven on her behalf. Rather than respond sympathetically, Ya’akov got angry and told Rachel that he is not G-d and cannot grant her wish. Rashi (30:2) explains that Rachel argued to Ya’akov that he should daven on her behalf just as Yitzchak davened for Rivka. Ya’akov responded that the situation was not parallel. Yitzchak had no children except through Rivka; Ya’akov, however, had other sons through Leah. The Ramban is already in troubled by Ya’akov’s harsh response, and at least on view in Midrash is unapologetic in condemning Ya’akov for his reaction.
Ksav Sofer reminds us of a Chazal that we have all heard: if put your own needs aside and daven on behalf of someone else in a similar situation, your own needs will be answered first. (I think recently there was a whole movement to try to pair people up so that A will daven for B and B will daven for A and both will get what they want. Of course, the idea behind the Chazal seems to be that you should have sincere empathy for another's needs, not simply use davening on their behald as a means to get your own desires fulfilled.) Yitzchak was willing to forgo asking Hashem for a child – if Hashem made him barren, so be it, he would be accept whatever Hashem dished out. But Yitzchak could not bear seeing Rivka suffer, knowing that she wanted to conceive. The Torah makes a point of telling us that Yitzchak’s tefilah (“Va’yei’aser lo Hashem” 25:21), not Rivka’s tefilah, was answered because it was Yitzchak who focused on his wife’s needs and davened on her behalf rather than focusing on himself and his own needs.
Ya’akov had to tell Rachel that the same would not work in their case. The power of Yitzchak’s tefilah came from his overlooking his own needs for a child and focusing only on Rivka’s needs. Ya’akov already had children from Leah –- he had no need to surrender or overlook that would cause a tefilah on Rachel's behalf to be accepted.
The approach is a bit pilpulistic, but I think there is a moral lesson here as well. While Chazal formulate the teaching that davening on behalf of someone else gets results as a general rule, I think it has particular significance in this context. Yitzchak's putting aside his own needs gave him the zechus to have children because what is being a parent all about if not giving up your own needs and wants for the sake of your children? How many sleepless nights, changes in schedule, agmas nefesh of all sorts, do all of us who are parents suffer for the sake of our offspring? Forget the general rule – here, the tefilah of Yitzchak for children worked because midah k’neged midah his selflessness was rewarded with parenthood, the ultimate test of selfless giving.
Coming back to the Maharal, perhaps it was not so much helping Rachel avoid suffering embarrassment that elicited Hashem’s response, but rather it was Rachel’s selflessness -- giving up her simanin, giving up her position as first wife, giving up her chuppah for the sake of someone else – that caused her to merit the ability to have a child, because being a giver, surrendering oneself on behalf of another, is the very definition of parenthood.