John Gill's Exposition of the Whole Bible
Exodus 13:17
And it came to pass, when Pharaoh had let the people go,.... Gave them leave to depart out of Egypt, and even urged them to be gone in haste upon the death of his firstborn:
that God led them not through the way of the land of the Philistines, although that was near; the land of the Philistines was the Pentapolis, or five cities of Gaza, Ashkelon, Ashdod, Ekron, and Gath, which lay between Egypt and Canaan; and their way through it to Canaan, out of Egypt, was the nearest they could go; and was, as Aben Ezra says, about ten days' journey; but Philo the Jew says l it was but three days' journey; and it seems, by the sons of Jacob going to and fro for corn, that it was no very long journey:
for God said: within himself, or he declared the following reason of so doing to Moses:
lest peradventure the people repent: which is said not as ignorant or doubtful, but, as Aben Ezra says, after the manner of men:
when they see war: the Philistines coming out against them to hinder their passage through their country; they being a warlike people, bold and courageous, and the Israelites, through their long servitude, of a mean, timorous, and cowardly disposition; and indeed as yet unarmed, and so very unfit to engage in war, and therefore would at once be intimidated:
and they return to Egypt; judging it more eligible to continue in their former bondage, than to fall a prey into the hands of such fierce and cruel enemies. This is the only reason mentioned for not leading them this way; but there were other secret reasons for it, which afterwards opened in Providence, as the doing that wonderful work for them, leading them through the Red sea as on dry land, and the destruction of Pharaoh and his host in it; and by being brought into a wilderness, a solitude, they would be in the fittest place to receive and attend to the body of laws given them, and where they were formed into a commonwealth and church state, previous to their entrance into, and possession of, the land of Canaan; and here also they were humbled, tried and proved, and had such instances of the power and goodness of God to them, as were sufficient to attach them to his service, and lay them under the greatest obligation to him, as well as would be of use to strengthen their faith and hope in him in future times of difficulty and distress.
l De Vita Mosis, l. 1. p. 627.