21:1

וַיהוָה פָּקַד אֶת־שָׂרָה כַּאֲשֶׁר אָמָר וַיַּעַשׂ יְהוָה לְשָׂרָה כַּאֲשֶׁר דִּבֵּר׃

And the Eternal remembered Sarah as He had said, and the Eternal did for Sarah as He had spoken.

Bereshit 21:1

וַיהוָה פָּקַד אֶת־שָׂרָה

Bereshit / Genesis 21:1 · Pshat

Bereshit 21:1

וַיהוָה פָּקַד אֶת־שָׂרָה כַּאֲשֶׁר אָמָר וַיַּעַשׂ יְהוָה לְשָׂרָה כַּאֲשֶׁר דִּבֵּר׃

And the Eternal remembered Sarah as He had said, and the Eternal did for Sarah as He had spoken.

Pshat פְּשָׁט

As He said, as He spoke

Avraham has just prayed for Avimelech, and the Almighty healed his house. And at once: "And the Eternal remembered Sarah." Why do these stories stand side by side? And why does the verse say it twice: "as He had said" and "as He had spoken"?

Rashi: whoever asks for mercy for another while needing the same thing is answered first. "As He had said" is the conception, "as He had spoken" the birth: it was said in the promise to Avraham (17:19), spoken at the covenant between the pieces (15:4). Sforno: "as He had said" means He lifted from Sarah the curse of Chava (Eve). "As He had spoken" means He gave her a son, although in old age daughters are usually born.

How Rashi and Sforno explain it

Rashi And the Eternal remembered Sarah

This story is placed here to teach you: whoever asks for mercy for his fellow while he himself needs the same thing is answered first. It says (20:17): "And Avraham prayed", and right next to it: "And the Eternal remembered Sarah". He had already remembered her before He healed Avimelech.
Remembered Sarah as He had said.
In the conception.
As He had spoken.
In the birth. Where was it "said", and where was it "spoken"? "Said" (17:19): "And the Almighty said: but Sarah your wife will bear you a son." "Spoken" (15:1): "the word of the Eternal came to Avram" at the covenant between the pieces, and there it says (15:4): "this one shall not inherit you". And He brought the heir from Sarah.
And the Eternal did for Sarah as He had spoken.
To Avraham.

Sforno And the Eternal remembered

Avraham prayed for Avimelech, and the Eternal remembered Sarah. As it says: "And the Eternal restored the fortunes of Job when he prayed for his friends" (Iyov / Job 42:10).
As He had said.
When He said: "and I will bless her" (17:16). He lifted from her the curse of Chava (Eve) in pregnancy, in birth and in raising children, as it says: "I will greatly multiply your pain and your pregnancy" (3:16).
And the Eternal did for Sarah as He had spoken.
As He said: "and I will also give you a son from her" (17:16). Not as is usual for those who have children in old age: mostly daughters are born to them.

Takeaway

"Pakad" (פָּקַד) means "remembered, took note". In the Torah this word often means: the Almighty remembered a person and did them good.
Rashi distinguishes "said" (אָמַר) from "spoke" (דִּבֵּר) and finds a place for each in the earlier promises.
The curse of Chava (Eve): "In pain you shall bear children" (3:16). Sforno says Sarah was free of it.