What does Genesis 21:23 mean?
Abimelech, king of Gerar, approached Abraham in hopes of formalizing their relationship in his kingdom. Abimelech understood that Abraham's God was powerful and was committed to blessing Abraham in all he did. Abimelech wanted to have a good relationship with Abraham and share in that blessing.To that end, Abimelech came with a request that Abraham would swear to several things by God. First, he asked Abraham to swear not to be deceptive with him or his descendants or even those who would come after. Abimelech pictured a long relationship between his own people and Abraham's people in the land of his kingdom.
Abimelech had reason to be wary of Abraham's deceptiveness. Abraham's lie about not being married to Sarah had nearly cost Abimelech his life when God struck him with an illness after taking Sarah for his own wife (Genesis 20:3–11).
On the positive side, Abimelech also asked Abraham to swear to deal kindly with him and with the land, in the same way that Abimelech had already been kind to Abraham.
The following verse contains Abraham's reply.