What was the underlying problem behind Hashem’s decision to lead the Children of Yisrael to Eretz Yisrael by a circuitous route?
(13,17) “And it was that when Pharaoh sent the people, G-d did not lead them by way of the land of the Plishtim for it was near, because G-d said: Lest the people reconsider when they see war and return to Egypt.”
Why is the fact that "it was near" given as the reason why the people might want to return to Egypt? We see later on in Bamidbar 14:4 that even when they were far away they nevertheless said “let us appoint a leader and return to Egypt” when they heard about the giants that they had to conquer in Eretz Yisrael!
To answer this let us first take a look at the posukim in parshas Vayeira. It says in Bereishis 18:16 “and the men arose from there and they looked upon S’dom, and Avrohom went with them to send them on their way”. This is followed by several posukim dealing with the dialogue between Hashem and Avrohom concerning S’dom, and then it says in posuk 22 “and the men turned from there and went to S’dom, and Avrohom was still standing before Hashem”. From this we see that initially they did not actually go to S’dom but merely looked upon it, and only later did they turn from there and go to S’dom. Why was this?
My father explained that it is well known that the reason for the mitzvah of accompanying someone at the beginning of their journey is in order that the merit of the one escorting should affect the one who is being escorted. We see this with Naomi that when she told Ruth to go down to the threshing-floor where Boaz was, she said (Ruth 3:3) “and I will go down to the threshing floor” instead of saying "you will go down", because, as Rashi explains, she was saying "my merit will go down with you" and so you should not be afraid that something bad will happen on the way.
Similarly, we find in the Torah in the section dealing with the Eglah Arufah that the elders of the nearest city had to stand next to the corpse and announce “our hands did not spill this blood” (Devarim 21:7). Rashi comments: Would it enter one’s mind that the elders are murderers? But what they were saying was that they did not see him and let him depart without food and without an escort. The implication is that if they had sent him away without an escort they would have caused his death and been like murderers, because if they had accompanied him their merit would have gone with him and so his murder would not have happened.
From all this it is clear that the merit of the one escorting influences the the one being escorted in his journey, and for this reason Chazal commanded us in the mitzvah of escorting.
Therefore, when the angels wanted to go to S’dom to destroy it they had a problem, because Avrohom was escorting them to send them on their way and he was a man of Chesed (loving kindness). Thus his escorting would influence them with Chesed so that they would not be able to destroy S’dom. Because of this “the men arose from there and looked upon S’dom”, but they did not yet go there because Avrohom went with them. Instead, they waited until Hashem came to speak with Avrohom about S’dom, and then they had the opportunity to go to S’dom because “Avrohom was still standing before Hashem”. This is what my father taught.
And just as the merit of a righteous person affects in a positive way the person whom he accompanies, so too the wickedness of a wicked person affects negatively the person whom he escorts. Therefore, when Yisrael went out from Egypt and Pharaoh accompanied them on their way (as the Zohar teaches), his intention was to harm them through his escorting by inclining their hearts to want to return to Egypt. But he thought that they would go by the way of the Plishtim since this was the closest route, and thus since his intention was that they should go that way, if they had gone that way they would have been strongly influenced by his wickedness and would have been very much inclined to return to Egypt. Therefore, Hashem led them on a different, circuitous route in the wilderness in order that Pharaoh’s negative influence would be severely weakened since this was not the route that he had in mind.
This is what the posuk means: “And it was when Pharaoh sent the people”, that is, when he accompanied them, Hashem “did not lead them by way of the Plishtim, because it was near”, and because it was near it was to this route that Pharaoh had channeled his negative influence, and therefore Hashem was concerned “lest the people reconsider when they see war and return to Egypt”. Therefore Hashem made them go around the wilderness so that Pharaoh’s negative influence was weakened, and thus even though we see later on that they still had an inclination to return, it was not so strong and so Moshe was able to stop them.