The Midrash often sheds light to the narrative in the Torah, that clarifies a certain behavior. An example of this, was the behavior of the brothers, after Yakov’s burial.
The Midrash tells us that Yosef took a detour after the funeral was completed in Hebron. He went back to the pit that his brothers mercilessly, had thrown him inside.
He stopped to say the blessing for one who had witnessed a miracle in that place. He was giving gratitude to G-d for having been saved from the snakes and scorpions.
Thanks to the Midrash, it now made sense why the brothers suspected that Yosef would now get his revenge, for what they did to him.
Yosef, of course, reassured them that he did not intend to act in place of Hashem. They were able to mend their relationship, and their remorse was accepted, and they lived harmoniously. They did not become slaves, until the last of the brothers, Levi, had passed away.
The Midrash clearly shed light on this story, that helped make it much more understandable.