Abimelech, king of Gerar, had taken Abraham’s wife as his own, but had done so innocently.
Sarah was a beautiful woman and Abraham, fearful for his life, had said to Abimelech: “She is my sister”. Indeed, Sarah, also fearful, had vouched for Abraham’s lie, telling the king: “He is my brother”.
But to save the failing couple from the consequences of their own cowardice and sin, God had appeared to Abimelech, warning him that if he valued his life he would immediately return Sarah to her husband — “and he shall pray for thee, and thou shalt live” (Gen. 20:7).
Can this be a correct account of what actually took place? Will God hear the prayers of guilty Abraham for innocent Abimelech? Yes, for Abimelech was a pagan who served other gods, while Abraham, with all his failure and sin, was God’s child.
Abraham’s prayer would, of course, be a confession of his sin and a plea that it might not be laid to the charge of innocent Abimelech, but nevertheless it was Abraham, not Abimelech, who had access to God.
This is an important lesson to learn, for many unsaved people point to the failures of believers and say: “I wouldn’t be guilty of that. If he goes to heaven, I certainly will get there”. Nevertheless, such “good” people are lost, while poor sinners who have trusted Christ for salvation are saved and “made accepted in the Beloved One” (Eph. 1:6).
There is only one way to find acceptance with God; this is by faith in His Son. source