When the king of Egypt let the Israeli people go, God did not lead them to go through the land of the Philistines. That was a shorter way, but God said, “It would be bad if my people change their minds when they realize that they will have to fight the Philistines to take their land, and then decide to return to Egypt.”