Rather than expressing a personal opinion I will follow @Dottard's example, which shows that Christian commentators see it various ways. Let me add a Jewish opinion and the finding of certain modern critical scholars.
Among Jewish sages, Rambam (Maimonides) says:
It appears feasible to me that this is the same well which Abraham
dug, in connection with which he gave Abimelech seven lambs as a
witness. The Philistines, however, stopped it together with the other
wells, whereupon Isaac dug it again and called it by the same name
which his father had called it. It is for this reason that the name of
the city is Beer-sheba: on account of the well (be’er) which both the
father and the son called by that name because there they swore both
Source critics who accept the documentary hypothesis, on the other hand, see this as an example of the same story being told twice in different traditions that informed the author of Genesis. A footnote in the NABRE says:
Scholars generally judge the account of the dispute over water rights
and its settlement by a legal agreement between Isaac and Abimelech to
be a Yahwist version of the similar story about Abraham in 21:22–34.
Among the evidence for this version being from the Yahwist source is that the name of God in this episode is yhwh, rendered as 'Jehovah' or 'the LORD' in English. In chapter 21's version, it is elohim, rendered as God.