The Battle of Refidim is one of the epic stories of the Chumash. The Jewish people were marching through the desert with their womenfolk, children and elderly when the Amalekites attacked out of the blue. Initially, it does not go well but Moses, supported by his brother Aaron and his sister Miriam’s son, Hur, ascend a nearby mountain. When Moses raises his hands, the army of Israel, under Joshua, prevail but when he puts his hands down, they lose.
The Sefer Habahir, “The Book of Brightness”, is a kabbalistic work, firstly available in the 12th century but widely attributed to the first-century authority, Rabbi Nechuniah ben Hakaneh. Quoted by the Ramban, the Bahir asks a pretty blunt question. What is Moses doing? Hands up and they win. Hands down and they lose. Why didn’t he keep his hands up? Because he became tired? He had Aaron and Hur to help him.
The Bahir answers that Moses could have kept his hands up and Joshua would have won easily but that “it is forbidden to hold one’s hand aloft (in prayer) for more than three hours”. Amazingly, the Vilna Gaon even extends this to not staying in shul for more than three hours.
The Bahir and the Gaon are saying that, of course, there is a power in prayer to change the course of nature and to defeat great armies. However, the challenge of our lives in this world is to win our wars ourselves and not through miraculous intervention. Prayer is to assist our efforts to overcome the challenges in life but not to replace them.