Though outwardly Yosef may have resembled Esav, internally he was forever loyal and committed to the teachings and values of Yaakov: "These are the products of Yaakov – Yosef."
Rashi, in his comments to the first verse of Parashat Vayeshev (in most editions of Rashi's commentary), cites a Midrash that describes Yaakov's fear of Esav in the wake of the latter's establishment of a large and powerful kingdom in Edom. The Midrash draws an analogy between Yaakov's fear and the concerns of a smith when an animal carrying an enormous load of flax enters his cramped shop. How, he wonders, will the entire stack of flax fit in such a small area? Finally, somebody tells him, "All it takes is a single spark from your anvil to burn the entire load!" Similarly, says the Midrash, Yaakov wondered how he could survive living near the powerful and hostile kingdom of Edom, the leaders of which were just enumerated in the previous chapter. The Torah therefore proclaims at the beginning of Parashat Vayeshev, "These are the products of Yaakov – Yosef." Yosef is the single spark that can ignite and consume the entire kingdom of Esav, as the prophet Ovadya famously foresees, "The House of Yaakov shall be fire, and the House of Yosef flame, and the House of Esav shall be straw; they shall burn it and devour it" (Ovadya 1:18).
How are we to understand this comparison between Esav/Edom and flax, or straw, and what is it about Yosef that enables him in particular to destroy and devour Esav?
Rav Yaakov Ariel (Chief Rabbi of Ramat-Gan), in his work, "Mei-Ohalei Torah," explains that straw and flax draw a lot of attention. They occupy a lot of space and often scatter about in the air. The actual kernels of grain, by contrast, are much smaller and less pronounced. And yet, it is clearly the grain that constitutes the primary component of the stalk. Likewise, Esav drew a lot of attention to himself. While his brother Yaakov sat quietly and unassumingly in his "tents" (25:27), Esav spent his days in the fields, demonstrating his strength and talents, earning for himself a widespread reputation. Esav was the straw, whereas Yaakov was the concealed and humble kernel of grain.
As the Midrash comments, Yaakov defeats Esav specifically through Yosef. Rav Ariel suggests that Yosef shared some of Esav's characteristics. He, too, was an attractive youngster who made a name for himself wherever he went. This perhaps gives us some idea as to why the brothers found it necessary to eliminate him. They perceived him as the Esav of the family, as a person of vanity and external, superficial charm, devoid of inner substance and ideals.
In truth, however, Yosef, unlike Esav, managed to incorporate his "straw"-like qualities within a far more meaningful, substantive life of ideals. His resistance to the advances of Potifar's wife demonstrated that his attractive exterior reflected, rather than supplanted, a profoundly spiritual interior. He used the enchanting effect he had on those around him to lead a nation to wealth and prosperity and save them from starvation, rather than for his personal gratification and honor. Though outwardly he may have resembled Esav, internally he was forever loyal and committed to the teachings and values of Yaakov: "These are the products of Yaakov – Yosef."
Yosef is therefore the spark that leads his people to triumph over the straw, Esav. It is he who represents Am Yisrael's ability to produce both the straw and the kernel – an appealing exterior and a spiritually meaningful interior. If we channel the qualities of Esav towards a higher purpose, if we utilize beauty and external grandeur for sacred purposes, then we can, indeed, emerge victorious over the enemy nation of Edom.