When God looks down at a wicked generation, the rabbis said, He searches for one righteous person to carry the weight of atonement for all the rest. This is the reading Aggadat Bereshit makes of (Ecclesiastes 7:28): "One man among a thousand I have found." God finds, in every generation, the person who will stand in the gap.
Jerusalem was full of wickedness when the prophet Jeremiah received his commission: "Roam the streets of Jerusalem, look around and take note; search her squares and see if you can find a man, one who acts justly and seeks truth, that I might forgive her" (Jeremiah 5:1). The righteous one who could be found would redeem the city. The one who could not be found left the city to its consequences. This is the doctrine of the hidden tzaddik — the unseen righteous person who holds a community together without anyone knowing it.
The man from Ramathaim — Elkanah, father of Samuel — is the figure the midrash points to in this passage. He was among the thousand who did not qualify. But from his house came one who did: Samuel, whom Hannah prayed into existence. The chain from barren woman to prophet to national judge runs through the divine search for one righteous person. God was not looking for a perfect city. He was looking for one person. He found Hannah's prayer, which found Samuel, which found a nation.
Chapter (48) 49: Torah [1] "And the LORD saw that Leah was hated" (Genesis 29:31). "The LORD upholds all who fall and raises up all who are bowed down" (Psalm 145:14). The measures of the Holy One, blessed be He, are not like the measures of flesh and blood. When a wealthy person loves someone, he clings to him and bends toward him, but when he sees that person lower his hand to the poor, he does not want him anymore and casts him aside. However, the Holy One, blessed be He, when He sees a person who is bowed down and lowering his hand, He extends His hand and lifts him up, as it is said, "The LORD upholds all who fall and raises up all who are bowed down." The verse does not say here, "The LORD upholds all who stand," but rather, "The LORD upholds all who fall and raises up all who are bowed down." Even the wicked, if they fall, He upholds them, as it is said, "The LORD upholds all who fall." "God forbid, if they fall, they have no standing, as it is said: 'The workers of iniquity have fallen; they are thrust down, and are not able to rise' (Psalms 36:13). And why? As it is said: 'They are like the chaff which the wind driveth away' (Psalms 35:5). But the righteous, even when they fall, are not cast down, for the Lord upholds their hand, as it is said: 'Though he fall, he shall not be utterly cast down, for the Lord upholdeth him with his hand' (Psalms 37:24). Therefore, trust in the Lord, for He supports all those who have fallen." [2] Another interpretation: "And the Lord saw that Leah was hated." Once He saw that Leah was hated, He said, "How can I make her beloved in her husband's eyes? Rather, I will raise her up and give her children first, so that she will be loved in them by her husband." Therefore, He opened her womb, as it is written in Ezra, "Caleb son of Hezron fathered children by Azubah his wife and by Jerioth" (1 Chronicles 2:18). Rabbi Berechiah said, "Azubah was his wife, and why was she called 'forsaken'? Because she was forsaken and barren. Therefore, the Holy One, blessed be He, said, 'Behold, I am giving her children, so that she will be beautiful in them,' as it is written, 'These were her sons: Ishhod, Shobab, and Ardon'" (1 Chronicles 2:18). Therefore, it is said, "The Lord upholds all who fall" (Psalm 145:14). [3] Another interpretation: "And the Lord saw that Leah was hated. And it shall be that the man [Jacob] will have two wives (Deuteronomy 21:15). Rabbi Berechiah said: This man is Jacob, as it is stated, 'And Jacob was a simple man' (Genesis 25:27). There were two wives, Rachel and Leah. The one [Leah] was beloved, as it is written, 'this is Leah' (Deuteronomy 21:15), and the other was unloved, as it is written, 'And the Lord saw that Leah was unloved' (Genesis 29:31). Both of them bore children for him [Jacob]. What Leah accomplished, Rachel did not accomplish, and what Rachel accomplished, Leah did not accomplish. Leah gave birth to kings, and Rachel gave birth to kings. Leah gave birth to prophets, and Rachel gave birth to prophets. Leah gave birth to judges, and Rachel gave birth to judges. And the firstborn son was to the unloved [Leah], this is Reuben, as it is stated, 'And Leah conceived and bore a son, and she called his name Reuben' (Genesis 29:32). And on the day that he [Jacob] bestowed his blessing, at the time when Jacob sought to depart from the world, he called his sons [to him]... 'he shall not give the son of the beloved [Rachel] precedence over the son of the unloved [Leah],' to Joseph [he gave this blessing], 'why should he [Reuben] be granted the rights of the firstborn?' (Deuteronomy 21:17) ["This is Reuben, as it is said, 'Reuben, you are my firstborn' (Genesis 49:3)]. Although I said that his impulsiveness was like water, do not withhold [praise] from him, for 'his bed is on high' (Genesis 49:4). What is 'on high'? When Moses comes, about whom it is written, 'And Moses went up' (Exodus 19:3), he will redeem you. Since Moses stood up and pleaded for him, as it is said, 'May Reuben live and not die' (Deuteronomy 33:6),. The Holy One, blessed be He, said to him, 'He shall live and not die,' [and thus] you [Reuben] are able to take two portions, as it is stated, 'For he [Reuben] should receive a double portion' (Deuteronomy 21:17). 'May Reuben live' - in this world; 'and not die' - in the World to Come. "For he is the beginning of my strength and so on. And it is written, 'my strength and the beginning of my might' (Genesis 49:3). Therefore, the Lord saw that Leah was hated." [4] Another interpretation: "And the Lord saw that Leah was hated. So she remained a barren woman in the wilderness..." (Jeremiah 12:8), what does it mean that "the Lord saw that Leah was hated"? God saw that Leah was destined to bear wicked children, and so he called her "hated." These wicked kings were Jehoram, Ahaziah, Joash, Menasseh, Amon, Jehoiakim, and Zedekiah. Jehoram is referred to as "he walked in the way of the kings of Israel, just as the house of Ahab did" (2 Kings 8:18). As for Ahaz, what is written about him? "And he did not do what was right in the eyes of the Lord his God, as his father David had done" (2 Kings 16:2). Isaiah said to him, "Ask for a sign from the Lord your God, whether it be in the depths or in the heights above" (Isaiah 7:11). Ahaz replied, "I do not want to test the Lord" (Isaiah 7:12). Joash, the third king, even though it is written about him that "Joash did what was right in the eyes of the Lord all the years Jehoiada the priest instructed him" (2 Kings 12:2), once Jehoiada the priest died, Joash became evil, as it is written: "When Jehoiada died, the officials of Judah came and paid homage to the king. Then the king listened to them. They abandoned the temple of the Lord, the God of their ancestors, and worshiped Asherah poles and idols" (2 Chronicles 24:17-18). "The fourth is Manasseh, as it is said, 'And he set up the image of Asherah, which he had made, in the house of which the Lord said...' (2 Kings 21:7). The fifth is Amon, as it is written of him, 'And he did what was evil in the sight of the Lord, as Manasseh his father had done, and among all the idols that Manasseh his father had made, Amon sacrificed and served them and did not humble himself before the Lord, as Manasseh his father had done' (2 Kings 21:20-22). The sixth is Jehoiakim, as it is written of him, 'And the rest of the deeds of Jehoiakim, and the abominations that he did...' (2 Kings 23:37), and not only that, but he also despised the word and drew the foreskin for himself. The seventh is Zedekiah, and what is written of him is, 'And he did what was evil in the sight of the Lord his God, and did not humble himself before Jeremiah the prophet, who spoke from the mouth of the Lord' (2 Kings 21:12). Thus, there were seven wicked kings, and therefore the prophet cries out, 'Woe to her who is pregnant with wickedness, to the daughter of seven! (Micah 5:1).' Therefore it is said, 'And the Lord saw that Leah was hated' (Genesis 29:31), see what will come out of the children of Leah, and he called her 'hated,' and the Lord saw that Leah was hated." [5] Another interpretation: And God saw who was hated, in the presence of her husband, when he rebuked her. When was this? As it is said, "And Jacob served Rachel for seven years" (Genesis 29:18). This is what his mother Rebekah told him, "And you shall dwell with him for a few days" (Genesis 27:44). And Jacob loved Rachel (Genesis 29:18). And Jacob said to Laban, "Give me my wife" (Genesis 29:21), and it was in the evening, and all night he lay with her, thinking that she was Rachel. When he woke up in the morning, he saw that it was Leah. He said to her, "Why have you deceived me?" She replied, "Didn't you deceive your father when he asked you, 'Are you my son Esau?' and you said, 'I am' (Genesis 27:19)? And when he blessed you, you said, 'Why have you deceived me?' But your father didn't say, 'Your brother Esau came with deceit and took your blessing' (Genesis 27:35)." Because of these things, which rebuked him, he began to hate her. God said, "Her only cure is to have children. I will give her children, and her husband will be humbled before her." Therefore, God saw that Leah was hated (Genesis 29:31). "He opens the womb" (Genesis 29:31). David mocks and says, "He executes justice for the oppressed; He gives food to the hungry. The Lord sets the prisoners free" (Psalms 146:7).