What is the meaning of (Proverbs 27:10): "A close neighbor is better than a distant brother"? The Holy One, blessed be He, said to Abimelech ben Jerubbaal: Better than you was Abimelech king of the Philistines, for he greatly honored Abraham, as it is said (Genesis 20:15): "And Abimelech said, Behold, my land is before you." Why did he say so? Rather, he saw all the honor with which the Holy One, blessed be He, had honored him, as it is said (Genesis 20:3): "And God came to Abimelech in a dream of the night." He said to him: Fool of the world, "you are a dead man because of the woman whom you have taken" (ibid.). All this tranquility is in your hand, and you are dying over a woman! Should you not have considered that she is a married woman (be'ulat ba'al)? What is this "married woman"? Rather, she is the spouse (be'ulah) of a husband (ba'al).
Why Abimelech the Philistine Outranked Abimelech ben Jerubbaal
Midrash Tanchuma Buber, Vayera 25:2
מהו טוב שכן קרוב מאח רחוק (משלי כז י) אמר הקב"ה לאבימלך בן ירובע, טוב היה ממך אבימלך מלך פלשתים, שהרבה כיבד את אברהם, שנאמר ויאמר אבימלך הנה ארצי לפניך (בראשית כ טו), למה אמר כן, אלא ראה כל כבוד שכיבדו הקב"ה שנאמר ויבא אלהים אל אבימלך בחלום הלילה (שם שם ג), א"ל שוטה שבעולם הנך מת על האשה אשר לקחת (שם), כל השלוה הזה יש בידך, ואתה מת על אשה, לא תהא סבור אלא היא בעולת בעל, מהו זה בעולת בעל (אל) [אלא] היא בעלת (בעלת) [בעל].