What does Genesis 21:12 mean?
Abraham was very displeased about Sarah's angry demand that Hagar and Ishmael be cast out of their household. The language may indicate that he became explosively angry. He clearly loved Ishmael, who was born to Sarah's servant Hagar at Sarah's own urging. This was not the first time Sarah reacted to Hagar with anger and bitterness (Genesis 16:4–6). Abraham is understandably concerned: he does not want to see his teenaged son die from being cast out.Now God speaks to Abraham and tells him not to be displeased. In fact, He tells Abraham to do whatever Sarah tells him to do. God agrees with Sarah's point about Isaac and his inheritance, restating what He said to Abraham in Genesis 17:21: Abraham's name will pass to Isaac, not Ishmael.
Though God will assure Abraham again in the following verse that Hagar and Ishmael will be blessed, it still seems harsh for Abraham to cast them out in into the wilderness. It doesn't seem that either the mother or the boy have done anything to deserve such treatment. The context, however, is clear that the Lord intended to take the responsibility for caring for Hagar and Ishmael Himself. He would not abandon them.
As painful as it was for Abraham, God wanted Abraham to end his role in Ishmael's life for the sake of the covenant and Israel's future.