In his Divine Comedy, the great Dante would weave a tale of waking up to find himself “lost in the woods”. He looks up and sees his home a short distance away on top of a hill, so he sets off to return there by the quickest possible route, i.e., by walking directly up the hill. But his way is blocked by wild beasts (symbols of cravings and appetites) that will not let him pass. Before being allowed to return ‘home’ (i.e., before attaining spiritual awakening), he will have to take a much longer journey, overcome many difficult obstacles, and learn and experience a great deal.
The Israelites had a similar experience when they ‘awoke’ from their ‘sleep’ in Egypt. Canaan was just a short distance away, just over the border to the northeast, about a ten-day’s march. But God did not lead them this way. He led the people roundabout, by way of the wilderness, by way of the Red Sea.