Parshas Vayeshev seems to start out following a very familiar narrative. The good brother and the bad ones. A father who doesn't quite seem to know what's going and sibling rivalry that escalates into a conflict between good and evil and will serve to define a nation.
And yet, unlike Yishmael and Esav, all of the brothers remain as the founders of the Jewish Nation.
Why is that? Once the brothers have kidnapped and sold Yosef into slavery, shouldn't they have been cast out as a lost cause the way that Esav and Yishmael were? How is that reconciliation proved possible here and not in the past?
To start with, it helps to look at what's missing. G-d.
None of the brothers mention G-d in Parshas Vayeshev at all. Nor does Yosef mention G-d until he refuses the demand of Potiphar's wife and at the very end where he is given the opportunity to interpret the dreams of Pharaoh's servants.
After Yehuda has masterminded the sale of Yosef, both brothers go into exile. Yosef and Yehuda are both parted from the family, Yosef involuntarily and Yehuda by choice. Yehuda goes off and marries an inappropriate Caananite woman, a culture that Avraham and Yitzchak had specifically disapproved of marrying into. Yehuda appears to be going down the same road as Esav, having entered into hostilities with his brother and then started a family that was unacceptable within the nation.
When Yosef is tempted with an inappropriate relationship by Potiphar's wife, he refuses her saying that it would be a sin against G-d. This is the first time Yosef mentions G-d. Yehuda gives in to an inappropriate relationship leading to a family tragedy and the death of his two unworthy sons. One tragedy leads to another and Tamar refuses being an eternal widow and degrades herself to have children by him. Yehuda orders her burned in what would be a tragic culmination of everything.
But when Tamar shows him the pledges, Yehuda concedes the righteousness of her case. And in doing so he admits that there is a superior moral authority to his. That everything isn't settled by superior force.
While Yosef travels his spiritual journey in physical exile, Yehuda travels his spiritual journey in spiritual exile. By acknowledging Tamar's claim, he also returns to G-d and he becomes worthy to have children who will become the leading royal dynasty of Israel. This dynasty will begin with King David, who like his ancestor, admits when has done something wrong and repents.
The first time any of the brothers mention G-d is when after their confrontation with Yosef, in his role as Viceroy of Egypt, they find that the money has been secretly returned to them. And they ask, "What is it that G-d has done to us"?
While Yosef, even as an Egyptian Viceroy, constantly mentions G-d in his conversations with them, this is the first time the brothers mention G-d. And they do so in a moment of recognition that they are being punished.
(To see the contrast, consider the difference between the way that the brothers speak and that even the man over Yosef's household talks, saying to them, "Your G-d, and the G-d of your father, has given you treasure in your sacks".)
The first time that a named brother references G-d is Yehuda. It's he who states, "G-d hath found out the iniquity of thy servants". The next and final time that the brothers mention G-d is during their message to Yosef. "We pray thee, forgive the transgression of the servants of the G-d of thy father."
The first mention of G-d is a question. What is G-d doing to us? Why are we being punished. It is fittingly Yehuda who offers the second mention, a concession that they had done wrong and were being punished by G-d. And the third and final reference names the brothers as servants of G-d asking forgiveness of the one they had injured in the final point of repentance.
This was why the stories of the bad brothers and the good brothers, the Yishmaels and Yitzchaks, the Esavs and Yaakovs, could come to an end. Even after terrible things, the brothers could be reconciled through a common faith in G-d and the recognition of a superior moral authority. This Esav and Yishmael could not do. It was why they and their descendants were permanently sundered from the Jewish people.
Esav never ceased to be angry at Yaakov. Yishmael never stopped his evildoing. Yehuda and the brothers had.
We all make mistakes. The Torah is not the narrative of perfect people who never did any wrong. It's the story of human beings, who had their weaknesses, but overcame them. Or didn't. Who made mistakes and then learned from them. Or didn't.
Even the horrifying actions of Yehuda and the brothers, the pain they inflicted on their brother and father, did not permanently close the door on them. The story of their conflict with Yosef is really the story of two exiles, the physical exile of Yosef and their spiritual exile, and their reunification as "servants of G-d" in a physical exile that would give way to a physical and spiritual redemption.
Yehuda and Yosef were both "lost" for a while. Yosef was lost physically. Yehuda lost his sense of right and wrong, his religion, his knowledge that G-d, not his will, was the true moral arbiter.
Yosef's story culminates with him saving his brothers, not merely from a physical famine, but spiritually by teaching them about G-d. The culmination of Yosef's life comes with him telling his brothers that G-d had intended everything that had happened and made it come out for good. That is the lesson that he had learned in Egypt. It's the lesson of all the exiles of Jewish history.
"What is it that G-d has done to us"?, "G-d hath found out the iniquity of thy servants" and "We pray thee, forgive the transgression of the servants of the G-d of thy father" are the stages of repentance.
Yosef brings his brothers through to the final stage. The brothers initially submit to Yosef, but in the climax they submit to G-d. But it is Yehuda's repentance that brings the journey, entirely apart from his exiled brother, when he concedes that, "She is more righteous than me." In that moment, Yehuda conquered his ego, which had caused him and his brothers to commit a horrifying crime. He conceded that he had done something wrong. This is the first step of repentance.
It is what neither Yishmael nor Esav could ever do. Like Lavan, they could never admit they were wrong and so they were incapable of religion. Like the Pharaoh challenged by Moshe, there was no room in their hearts for G-d.
The Sages say that one who conquers himself is mightier than the conqueror of a city. Yehuda's repentance enabled him to begin a journey that made him the leader of the family in truth, not merely through force of personality, but through sacrifice and repentance.
It is Yehuda, not Yosef, who ultimately becomes the leader, because while Yosef is righteous, it is Yehuda who can return from a spiritual exile and find G-d again, and it is this quality that Israel would need more than any other. Yosef's dreams made him a prophet, but repentance is still needed even when the people have become unworthy of prophecy.