Genesis 21:14-19, NIV
14 Early the next morning Abraham took some food and a skin of water and gave them to Hagar. He set them on her shoulders and then sent her off with the boy. She went on her way and wandered in the Desert of Beersheba.
15 When the water in the skin was gone, she put the boy under one of the bushes. 16 Then she went off and sat down about a bowshot away, for she thought, “I cannot watch the boy die.” And as she sat there, she began to sob.
17 God heard the boy crying, and the angel of God called to Hagar from heaven and said to her, “What is the matter, Hagar? Do not be afraid; God has heard the boy crying as he lies there. 18 Lift the boy up and take him by the hand, for I will make him into a great nation.”
19 Then God opened her eyes and she saw a well of water. So she went and filled the skin with water and gave the boy a drink.
Genesis 21-25-31, NIV
25 Then Abraham complained to Abimelek about a well of water that Abimelek’s servants had seized. 26 But Abimelek said, “I don’t know who has done this. You did not tell me, and I heard about it only today.”
27 So Abraham brought sheep and cattle and gave them to Abimelek, and the two men made a treaty. 28 Abraham set apart seven ewe lambs from the flock, 29 and Abimelek asked Abraham, “What is the meaning of these seven ewe lambs you have set apart by themselves?”
30 He replied, “Accept these seven lambs from my hand as a witness that I dug this well.”
31 So that place was called Beersheba, because the two men swore an oath there.
Genesis 21:33, NIV
33 Abraham planted a tamarisk tree in Beersheba, and there he called on the name of the Lord, the Eternal God.
In the first part where Ishmael drank from the well, Beersheba was already named.
But it was in the second part involving Abraham and Abimelek where they explained how Beersheba got its name.
I suppose they are both referring to the same Beersheba? And Ishmael might have drank from the well that Abraham dug?
Extension to the main question: If Ishmael drank from the well that Abraham dug, then was Ishmael also placed under the tree that Abraham planted?