When the Israelites left Egypt, they fled Pharaoh and his troops. It is not clear, however, that they fled the people of Egypt. Some readings of the Exodus story make the Egyptians generously encouraging to the departing slaves. (Other readings make them fearful due to the plagues.) Later in the Torah, we are cautioned any number of times to deal kindly with the Egyptians.
When you add to our sacred text the practice of spilling drops from our wine glasses when we remember the plagues at the Seder, it becomes pretty clear that whatever animosity we had toward Egypt was directed toward the person and entourage of Pharaoh. (Remember, it was Pharaoh's daughter who saved Moses from drowning.)
Contrast the Egyptians with the Amalekites, whom we are commanded to obliterate. Though enslaved by Egypt for 400 years and attacked by Amalek once, we are instructed to remember Egypt for its kindnesses.
The difference is almost counterintuitive. We have a much more profound grievance against Egypt, if not the Egyptians. We have a series of demonstrated victories over the remnant of Amalek — in the wilderness, at the hand of King Saul, in ancient Persia — wherever "Amalek" turns up and attacks.
Reinterpreting these conflicting instructions is not without its peril. Torah is pretty clear that we are to pursue and destroy Amalek, and that we are to treat Egypt with dignity and deference. Placing the teachings in a later historical context may help, but only momentarily. What is the eternal lesson, the reason these sets of teachings are included among other sacred obligations?
I try not to read too literally in these circumstances. The civilian population of our enemies, if they resist the evil that governs them, even in small ways, makes up the Egyptians in any place or time. We are cautioned not to impute to them the qualities of their Pharaoh, but to judge them to their credit for their capacity for kindness. Similarly, whenever genuine evil crops up, we find Amalek, as we have in times and places diverse and unrelated. Hitler and Haman are related only by behavior, not by genes.
Amalek is certainly loose in the world again, and he terrorizes his own as sure as he terrorizes us. It is important to keep our focus on those who would perpetuate the legacy of our ancient foe and devote ourselves to eradicating his influence. In the process, however, we should remember how our ancestors were instructed to recall the kindness of those who bear the reputation of "oppressors." The act of compassion when we need it most should not be ignored in the heat of anger. And when the innocent necessarily suffer because of the plagues of conflict, our cup of joy should be diminished, even in victory.