If we had been among the Israelites leaving Egypt after 400 years of slavery, we would likely have seen Pharaoh as part of the problem—and he was. Yet God saw something more.
Inexplicably, the Lord told Moses to take the people back toward Egypt and camp with their backs to the Red Sea so Pharaoh would attack them (Ex. 14:1-3). The Israelites thought they were going to die, but God said that He would gain glory and honor for Himself through Pharaoh and all his army, “and the Egyptians shall know that I am the Lord” (vv.4,17-18).
When we simply cannot understand why God allows circumstances that threaten to overwhelm us, it’s good to remember that He has our good and His glory in mind. If we can say, “Father, please enable me to trust and honor You in this situation,” then we will be in concert with His perspective and plan.

Faith helps us to accept what we cannot understand. (RBC)