What does Genesis 21:22 mean?
Abimelech is the king of Gerar. He and Abraham had met under difficult circumstances, as described in Genesis 20. In short, Abraham had lied about Sarah not being his wife (Genesis 20:2). Abimelech had taken her for his own wife only to be struck with an illness and threatened with death by Abraham's God (Genesis 20:3–6). After confronting Abraham about the reasons for his lie, Abimelech had returned Sarah to Abraham, untouched, along with gifts of animals, servants, silver, and the land upon which Abraham was now settled (Genesis 20:8–15).Apparently, realizing how abundantly God was blessing Abraham, now including the miraculous birth of a promised child, Abimelech set aside any lingering resentment over the incident and hoped to become Abraham's formal ally.
He brought with him the commander of his army and opened by stating flatly that it was apparent to him that God was with Abraham in everything he did. Having spoken to God himself in a dream, Abimelech had firsthand reason to be impressed with the level of God's favor for Abraham.