The Targum Pseudo-Jonathan on Genesis 30:21 preserves one of the most startling moments in the entire tribal genealogy.

Originally, says the Aramaic tradition, the baby in Leah's womb was to be a seventh son. Leah had already had six sons and knew how the count worked: twelve tribes distributed among four mothers, six from her and two from each of the handmaids would already leave Rachel with only two. Another son in Leah's womb would push Rachel down to one, or even none.

So Leah prayed. Judgment is from before the Lord, that there shall be from me a half of the tribes; but from Rahel my sister shall go forth two tribes, even as they shall proceed (in like manner) from each of the handmaids.

She asked Heaven to preserve dignity for her sister. She did not want Rachel to be reduced to the status of a handmaid. Her prayer was for Rachel to keep the full portion of a primary wife.

The Targum continues: And the prayer of Leah was heard before the Lord; and the infants were changed in their wombs; and Joseph was given to the womb of Rahel, and Dinah to the womb of Leah.

A miraculous swap. The male fetus passed from Leah to Rachel, and the female fetus passed from Rachel to Leah. Leah bore a daughter, Dinah, instead of a seventh son. Rachel would bear Joseph — the tribe that would save Egypt from famine and the nation from extinction.

This is a stunning picture of matriarchal generosity. Leah, who had struggled her whole life against being the less-loved sister, prayed for Rachel's dignity and received a daughter in return. Rachel received the son who would be viceroy of Egypt. Heaven rearranged wombs in response to the prayer of a rival.

The takeaway: the greatest prayers in Jewish history are often prayers for other people. Leah prayed for Rachel, and the whole future of the tribes shifted.