But Abimelech had not come near her; and he said, “Lord, will You slay a righteous nation also?”
Genesis 20:4 (NKJV)
The text is very clear that Abimelech didn’t sleep with Sarah. Why is it so important to mention it here, while keeping it vague back in Genesis 12, when Pharaoh takes Sarai?
The rabbis say that this serves a very important purpose.
Based on the timeline, this encounter in Gerar is near the time Isaac should be conceived.
By drawing attention Abimelech’s words AND by reinforcing them with God’s own words (“I didn’t LET you go near her!”), nobody in the story can question if Abraham is the father.
Furthermore, the Tze’enah Ure’enah states the following to reinforce this!
The explanation is that the Holy One brought it all on the household of Abimelech that they could not give birth to children, could not urinate or defecate. All of their bodily orifices were stopped up. Even a hen could not lay an egg. It was hoped that Abimelech would understand and notice that his sin was because he had taken Sarah as a wife.
Tze’enah Ure’enah on Genesis 20:4:1