Eventually, Isaac settled in Beersheba. The king of the Philistines then asked Isaac to forge an alliance with him, acknowledging that Isaac was blessed with Divine favor and success.
The Reward of Perseverance
וַיֹּאמְרוּ רָאוֹ רָאִינוּ כִּי הָיָה ה' עִמָּךְ וַנֹּאמֶר תְּהִי נָא אָלָה בֵּינוֹתֵינוּ בֵּינֵינוּ וּבֵינֶךָ וְנִכְרְתָה בְרִית עִמָּךְ: (בראשית כו:כח)
[The king of Philistia and his entourage] said [to Isaac], “We have seen that G‑d has been with you, so we said: Let there now be a solemn oath between us, and let us make a covenant with you.” Genesis 26:28

At first, the Philistines seized the wells that Isaac dug, but in the end they actively sought him out to make peace with him. Similarly, even our most well-intentioned efforts or spiritual labors can sometimes boomerang, actually strengthening the forces that oppose holiness. However, we learn from Isaac to not be discouraged in the face of such unexpected setbacks. Rather, we should continue our endeavors, which are certain to eventually succeed.1