וַיְהִי, בְּשַׁלַּח פַּרְעֹה אֶת-הָעָם, וְלֹא-נָחָם אֱ-לֹהִים דֶּרֶךְ אֶרֶץ פְּלִשְׁתִּים, כִּי קָרוֹב הוּא - And it came to pass, when Pharaoh had let the people go, that Gd led them not by the way of the land of the Philistines, for it was near (Exodus 13:17)
These opening words of the parasha explain the purpose of 40 years in the desert. Gd chooses not to take the Israelites to the Landof Israel by way of the most time efficient route. The reason mentioned is that this route would cause them to engage more quickly in the war necessary to conquer the inhabitants of the homeland, the Philistines – who resided up to the coastal plain of the Land, and the worry was that the Israelites would fear the war and return to Egypt. With the sheer number and magnitude of all of the miracles that Gd performs in order to execute the Israelite exodus from Egypt – plagues, splitting the sea, manna, water from rocks and more – why would Gd decide not to ensure their safety and just bring the Israelites home quickly? Perhaps the answer is found in a response to the question of why does evil exist in the world….were it not for evil, there would be no recognition and appreciation of good.