ויהי בשׁלח פרעה את העם ולא נחם א-להים וכו’ י
And it came to pass, when Pharaoh had let the people go, God did not lead them by way of the land of the Philistines
In Midrash Rabbah it is deduced that “ויהי” (and it came to pass) is an expression of lament (לשון צער). The Midrash offers many explanations of who it was that cried “woe” as the people left Egypt. But our master explains that it is the Torah that raised her voice and cried “woe,” because, until Pharaoh chased them out with a strong hand, the children of Israel did not want to leave Egypt, but preferred to stay in that murky valley. God therefore “did not lead them by way of the land of the Philistines, although that was near, for God said, lest the people repent upon seeing war, and return to Egypt.” (שביבי אש)
שם שם לו חק ומשפט ושם נסהו ויאמר אם שמוע תשמע לקול ד”א והישר בעיניו תעשה והאזנת למצותיו ושמרת כל חקיו
There the Lord made for them a statute and an ordinance . . . saying, “If you will diligently hearken to the voice of the Lord your God, and do what is right in His eyes, and give heed to his commandments, and keep all his statutes. . .”
Rashi explains: At Marah he gave them a few sections of the Torah so that they might engage in the study thereof; namely, the sections concerning the Sabbath, the red heifer (פרה אדומה), and the laws of justice (דינים).
Our master gave a twofold reason for the choice of these three sections. The Eternal wanted to provide the Israelites at Marah with one commandment as an example of each of the three categories of commandments in the Torah. The three categories are the commandments of reason (מצות השכליים), the commandments of understanding (מצות השמע), and the statutes (חוקים). They were informed about the commandments at Marah just as a prospective convert is informed about some of the easy commandments and some of the difficult commandments, so that the convert might be able to draw some inference from those commandments about the other commandments. The commandments of reason are those that we already know ourselves from our own reasoning, and which, even had we not been commanded to observe them, we ourselves would have understood ought to be kept. Corresponding to these commandments, God instructed them in the laws of justice (דינים) which also are derived from reason. Then there are the commandments of understanding (מצות שמע) which are commandments that we would not have known ourselves without being commanded to observe them, but, upon hearing them, we find reason to understand and praise them. And corresponding to this category, God commanded them to observe the Sabbath while explaining to them that reason for its observance is that it is an eternal sign of the covenant between God and the people of Israel. And the statutes (חוקים) are those commandments which our understanding is too limited to comprehend even after we have heard them. And corresponding to this category, God gave them the law of the red heifer, whose ways are hidden from us.
This explains why the Scripture says (Exodus 15:26): “If you will diligently hearken to the voice of the Lord your God” which is a general statement encompassing the entire Torah, its laws of justice (משפטיה), statutes (חקותיה), and testimonies (עדותיה). The Scripture then mentions specifically “והישר בעיניו תעשה” (and will do that which is right in His eyes) referring to the commandments of reason that they were able to know would be right in the eyes of God even without being commanded to do so. Next the Scripture says “והאזנת למצותיו” (and you shall give heed to His commandments), referring to the commandments of understanding, which we understand not upon first hearing, but only afterwards. Finally, the Scripture says, “ושמרת כל חקיו” (and keep all His statutes), referring to the commandments whose rationale and purpose are hidden, and whose manner of observance is distant. (שביבי אש)