The Torah’s narratives about King Avimelech of Gerar are quite mystifying. Avimelech appears to be full of contradictions and is subject to both praise and criticism by the Meforshim (Commentators). What was this man all about? And why do the episodes of Avimelech in Parshat Vayera appear in very close proximity to Akeidat Yitzchak (the Binding of Isaac)?
The Ramban (on Bereshit 20:2) contrasts Avimelech and his nation with Pharoah and his nation, explaining that unlike the Egyptians, who were overtaken by licentiousness, the people of Gerar, where Avimelech was king, were decent, and Avimelech seems to have set a personal example, for the Ramban refers to him as pure and just. So too, at the feast of Yitzchak (ibid. 21:8), Rashi cites a midrash that among the attendees were “Shem, Ever, and Avimelech, the gedolei ha-dor (most eminent people of the generation)”.
In contrast, we find that when Avimelech told God that he acted in good faith upon taking Sarah (ibid. 20:5-6, with Rashi citing midrash), God replied that although Avimelech did not intend to sin, Avimelech’s claim that he was “of clean hands” was not true.
Similarly, explaining the intent of Avraham’s statement to Avimelech (ibid. v. 11) that “there is no fear of God in this place”, Rashi (from midrash) elaborates: “When a guest comes to town, should he be asked if he needs food and drink, or should he be asked if the woman with him is his wife or sister?” We even find that upon the arrival of Avraham and Sarah in Gerar (ibid. v. 5), Avimelech asked not only Avraham about Sarah’s status, but he also asked Sarah herself, as well as Avraham’s servants and herdsmen (Rashi, from midrash); so extremely focused was Avimelech on taking Sarah.
When Avimelech and his general later approached Avraham (ibid. 21:22-32) and Yitzchak (ibid. 26:26-33) to make treaties, as Avimelech realized the greatness of Avraham and Yitzchak needed to be on good terms with them, he did not own up to the theft of their wells nor apologize for having roughly expelled Yitzchak from Gerar out of jealousy; Avimelech sought the treaties for reasons of self-interest, and that was it.
How are we to understand such a contradictory personality?
The answer seems to be that Avimelech feared God and was in that respect certainly unique among the leaders of that generation, in which avodah zarah and giluy arayot (idolatry and immorality) were rampant even among the highest echelons of society (e.g. Mitzrayim, Egypt, which was actually far more advanced than Cana’an in terms of knowledge and technology). But there was a limit to Avimelech’s yirat shamayim (fear of heaven), for it was not with enthusiasm and passion, but rather with apathy and half-heartedness. Avimelech did not intend to commit a sin of giluy arayot, nor did he himself directly steal anything (v. Or Ha-Chaim on ibid. 21:26); Avimelech was technically free of sin, yet he allowed problematic things to occur under his watch, and his approach was one of seeking loopholes and of bypassing the system, so as to try to be in legal compliance with God’s command, but sorely lacking the right attitude of wanting to serve God and proactively do what is right in His eyes.
At the Akeidah, we read that when the malach (angel of) God stopped Avraham at the last second from slaughtering Yitzchak, he lauded Avraham as God-fearing for having passed the test (ibid. 22:12). Avraham thereupon sacrificed a ram to God in place of Yitzchak, without being commanded to do so, naming the site of the Akeidah in observance of God’s appearance there – and then the berachot (blessings) from God really came: “I hereby swear that since you did this thing and did not withhold your son… that I will bless you and greatly multiply your offspring as the stars of the heavens and as the sand on the seashore, and your descendants will overtake the gate of their enemies. And all peoples of the earth will be blessed through your progeny…” (ibid. v. 16-18)
It was due to Avraham’s proactive commitment to God and his loving and dynamic desire to serve Him, evidenced by the voluntary and passionate sacrifice of the ram as a dedication to God in place of Yitzchak when Avraham could have instead taken a major sigh of relief and immediately gone home (v. Rashi from midrash on v. 13), that the berachot showered down.
This exceptional dedication to God is Avraham’s hallmark and is his legacy and charge to us, and it is why the Torah presents the episodes of Avimelech in Parshat Vayera as a lead-up to the Akeidah. to contrast the attitudes of Avimelech and Avraham in complying with God's Word, highlighting and showcasing what made Avraham unique and why he merited to be our exemplar and patriarch.