[And the LORD remembered Sarah (Genesis 21:1).] There are four keys: the key of sustenance, and the key of rain, and the key of graves, and the key of barren women; and the four of them are in the hand of the Holy One, blessed be He. The key of sustenance, from where? As it is said, "You open Your hand [and satisfy the desire of every living thing]" (Psalms 145:16). And the key of rain, from where? As it is said, "The LORD will open for you [His good treasure, the heavens, to give the rain of your land in its season]" (Deuteronomy 28:12). And the key of graves, from where? As it is said, "When I open your graves [and bring you up out of your graves]" (Ezekiel 37:13). And the key of barren women, from where? As it is said, "And God remembered Rachel… and He opened her womb" (Genesis 30:22).
The Four Keys Held in the Hand of the Holy One
Midrash Tanchuma Buber, Vayera 35:1
[וה' פקד את שרה]. ארבע מפתחות הן, מפתח של כלכלה, ומפתח של מטר, ומפתח של קברות, ומפתח של עקרות, וארבעתן ביד הקב"ה, של כלכלה מנין, שנאמר פותח את ידך (תהלם קמה טז), ושל מטר מנין, שנאמר יפתח ה' לך וגו' (דברים כח יב), ושל קברות מנין, שנאמר בפתחי את קברותיכם (יחזקאל לז יג), ושל עקרות מנין, שנאמר ויזכור אלהים את רחל וגו' ויפתח את רחמה (בראשית ל כב).