Why did Sarah die? There is a Midrash that says that she died from shock when the Satan showed her that Isaac had been slaughtered at an altar by Abraham (Genesis 22:16).
There is also an opposite Midrash that says that she died from shock when the Satan showed her that Isaac not had been slaughtered at an altar by Abraham (Genesis 22:12), fearing that he was rejected as not holy enough.
Let me bring a third reason. The first word of our Portion of the Week reads Vayihyu (Genesis 23:1). This verb means: “Were being” – life in Hebrew has the plural form. The word’s numerical value is 37.
Then it says, 37 was the life of Sarah. A childless woman is as dead – Isaac was 37 when he was on the altar – Sarah had 37 years that she felt really alive.
(Just like about Jacob it reads, Vaichi (Genesis 47:28) – he lived – the numerical of 34, symbolizing 17 years with Josef before he disappeared on him (Genesis 37:2) and another 17 years reunited with him in Egypt (Genesis 47:28).)
So, the numerical value of Vayihyu is 37. We have a tradition that G^d ensures that there will be 36 perfect Saints alive at all times so that the world merits to continue. 37. Rebecca was born (Genesis 22:23 – see Rashi), making it one more.
The Rabbis explain (Genesis Rabba 58:2), quoting “The sun rises and the sun sets” (Ecclesiastes 1:5) that before G^d causes the sun of a righteous person to set, He causes the sun of the following righteous person to rise. Sarah would not die until Rebecca had appeared.
However, don’t think for a minute that G^d killed Sarah because she was not needed anymore. Rather, Sara died slowly, as it says (Genesis 23:2) Vatamot – “She was dying,” not “She died.”
She had been worried for a long time whom her saintly son could marry in a world steeped in evil. She was a bigger prophet than her husband who had to send Eliezer to look for his future daughter-in-law (Genesis 24). But Sara, as soon as Rebecca was born, saw and knew and now felt at peace enough to let go and die, and facilitated the next generation to take center stage.
Yet, last but not least, a Commentator mentions that Vayihyu is the plural form of Vaihi, which always announces suffering. So, he concludes that Sarah died of shock, as given by either of the above two Midrashim. However, I would like to suggest that this suffering could also be that our first Matriarch was going to die – the first and one of only four women whose death is mentioned in the Hebrew Bible. Shocking for us, not for her. And for her loved ones.