The standard explanation for God denying the Israelites the most direct route to the Land of Canaan is that it was too well fortified for the liberated Israelites to manage. Thus, for example, Professor Jeffery Tigay writes (Jewish Study Bible, p. 133) that the detour south was intended “to avoid demoralization.” But the twelfth century Tosafists offer an entirely different and novel explanation.
The Hebrew word “karov,” translated as “nearer,” is rejected by the Tosafists in favor of rendering the word “kin, relative.” That is to say, God did not allow the Israelites to take the closer route because “they were His kin.” According to the Tosafists, this means one of two things. The first possibility is that “they” refers to the Egyptians, meaning that the Philistines were related to the Egyptians. The genealogy of Noah after the Flood mentions that among the descendants of Ham, one of Noah’s three sons was Mitzrayim (Egypt) (Genesis 10:6) and among his descendants were the Philistines (Genesis 10:13). The import of this kinship, according to the Tosafists, is that the Philistines would attack the Israelites out of sympathy for the Egyptians their kin, now bereft of their slaves.
The second possibility is that “they” refers to the Israelites and the verse is reporting that God did not allow the Israelites to take the closer route out of His kinship with Israel. The people Israel are called “His kin” (Psalms 148:14). Therefore, according to the Tosafists, “He did not lead them in the usual way.” Without any further explanation, the Tosafists’ explanation remains cryptic. But one way to interpret it is as follows. People grow intellectually and emotionally when they successfully face challenges. While parents get this, they are far more interested in making life easier for their children. So they pick out their clothes, cut their meat, finish their sentences. But eventually, parents need to learn that by making life easier now children are being denied the experiences they need to process to make life navigable later. That is why, according to one view in the Talmud (Kiddushin 29b), parents need to teach their children to swim. Not, as RaShI explains, to give them a life-saving skill, but in order to learn to let go.
God sees the Israelites as His people and the Israelites see God as their Heavenly Father. The usual route would be the most direct. However, God chose to make the journey more challenging for His children so that they would be the better for it. Such is life. Sometimes we gain the most through struggling.