Genesis 20 records the background of the birth of Isaac. Due to a severe famine in the land, Abraham travels to Gerar where he encounters Abimelech, the king of Gerar. In order to cement a marriage alliance, Abimelech seeks to marry Sarah, as Abraham said she was his sister and not wife. God had to intervene, again, showing that even when we make a mess of things, He ensures things work out.