The Rishonim (Ibn Ezra, Ramban) ask why Moshe started to daven and scream to Hashem when he saw the Egyptian army in hot pursuit of Bnei Yisrael – Moshe knew what was going to happen, as he had been told advance by Hashem (14:4) that the Egyptians were going to give chase?!
A short few weeks ago we discussed the fate of Pharoah’s three advisors: Bilam, Iyov, and Yisro. Bilam wanted Bnei Yisrael eliminated, so in turn he was eliminated. Yisro sacrificed everything and fled Egypt, so in turn he ended up regaining prestige as Moshe’s father-in-law. Iyov was silent, and so he was punished with suffering. What exactly did Iyov do wrong? Perhaps he was simply waiting for the right moment, calculating the best time to intervene in a way that would have the greatest effect? The Brisker Rav answers that when in pain, you scream, you don’t calculate. Iyov saw the tragedy of Bnei Yisrael’s enslavement unfolding before him and he felt no pain.
The Sefas Emes says the same idea here. Moshe knew the Egyptians would be after Bnei Yisrael and he knew that he had Hashem’s promise that Bnei Yisrael would somehow be saved. But when faced with danger, you don’t calculate what was promised, what you knew would happen, what you know will happen – when it hurts you scream; the visceral reaction kicks in, which in the case of Moshe Rabeinu meant the scream of tefilah. Adds the Sefas Emes, Hashem knows in advance that this is the behavior of tzadikim. His promises take into account that the Moshe Rabeinu’s of the world don’t listen to havtachos and then sit back and relax, but rather they still cry out and increase their avodah as if everything depended on it.