What does Genesis 20:15 mean?
Years before this, Abraham had lied about Sarah, causing the Pharaoh of Egypt to take her as a wife. When the Pharaoh realized what had happened, he immediately returned Sarah (Genesis 12:18–19). At the same time, he immediately had his men escort Abraham and his family out of Egypt (Genesis 12:20). That Pharaoh didn't want to be anywhere near a people whose God brought plagues on his household.Now, after a very similar lie from Abraham results in almost the same consequences, king Abimelech has a different response. In addition to returning Sarah, along with gifts of herds, flocks, and servants, the king of Gerar offers to allow Abraham to settle anywhere in his kingdom that he would like.
It's hard to imagine he was happy with Abraham. More likely, the king was eager for Abraham to pray for him and for his household so that they would live. It's also possible that Abimelech wanted to prove his good intentions to the Lord.