In Parashat VaYeishev, we read of Yosef and his brothers, and of how their hatred for Yosef leads to his sale, to his enslavement, and ultimately, to the Egyptian exile. Hashem had always intended for the exile to occur, having informed Avraham of it during the Brit Bein HaBetarim, and He used the brothers as a means to achieve it.
Ramban notes that when Yosef seeks his brothers he is unable to locate them until a “man” finds him wandering in the fields. Ramban sees this as an indication that Yosef would have remained unable to find the brothers under normal circumstances. This man must have been a messenger sent by Hashem to lead Yosef to his brothers. Clearly, Hashem was pulling the strings to bring Yosef to his brothers and then down to Egypt. Why did Hashem choose to use the brothers?
Chazal teach us that Hashem effects good things through worthy people and bad things through unworthy people. Yosef’s brothers did not contain their hatred and jealousy, instead selling him into slavery. Though exile was always in Hashem’s plan, he used the brothers to effect this “bad” turn of events to give a message to all generations: hatred and jealousy are unacceptable.