אלשיך
Alshekh on Torah, Exodus 2:5
Q — Why does the Torah bother telling us that Pharaoh's maidens were 'walking along the riverbank'? It seems like an idle detail.
A — It is reporting a miracle of השגחה פרטית. By natural geometry, the maidens (walking along the bank where the basket sat) should have spotted the basket *before* Pharaoh's daughter (who was bathing in the river itself). The Torah is highlighting that the opposite happened: Hashem caused the righteous Bat Pharaoh to see Moshe while the maidens — who would have killed him 'על דבר מלך שלטון' — did not. The whole episode is a demonstration of the principle 'ה' צבאות יעץ מי יפר': Pharaoh's advisors thought they had defeated God's plan by ordering the boys drowned, and at the moment of their apparent victory the king's own daughter — 'כבודה בת מלך פנימה,' who had never gone out to bathe in the river — was sent to raise their conqueror in the palace.
הורה הכתוב את אשר הפליא הוא יתברך לעשות עם משה. כי הלא לפי הטבע, היה קרוב הדבר יותר יפגעו נערותיה עם משה מלפגוע בו בת פרעה. כי הלא הוא היה 'על שפת היאור', ובת פרעה ירדה לרחוץ על היאור ממש פנימה, ונערותיה הולכות על יד היאור, שהוא על שפת היאור. והן הנה ראויות לראות את התיבה אשר על שפת היאור, יותר מבת פרעה. והאלהים עשה, כי היא שהיתה צדקת ותחמול עליו, ראתה את התיבה, ונערותיה לא ראו.