Another interpretation of (Proverbs 16:7) "When the Lord is pleased <with a man's ways>": these are Israel, about whom it is written (Deuteronomy 27:14) "<and> every man of Israel." When they were in Egypt, once the hour came for them to be redeemed, (Proverbs 16:7) "He makes even his enemies to be at peace with him" — this is Pharaoh, about whom it is written (Exodus 15:9) "The enemy said: I will pursue, I will overtake, I will divide the spoil." Therefore it is said (Exodus 13:17): "And it came to pass when Pharaoh let the people go."
When the Lord Is Pleased Even Pharaoh Makes Peace at the Exodus
Midrash Tanchuma Buber, Beshalach 3:4
ד"א ברצות ה', אלו ישראל שכתיב בהם (וכל) [כל] איש ישראל (דברים כז יד), כשהיו במצרים כיון שבאתה השעה להיגאל, גם אויביו ישלים אתו, זה פרעה, שכתיב בו אמר אויב ארדף אשיג אחלק שלל (שמות טו ט), לכך נאמר ויהי בשלח פרעה.