At the end of Exodus 17, there is war with Amalek. In chapter 18, on the other hand, peace with Midian. The episode in which Amalek attacks, is one in which Moses has to get help in order to work smarter and pray longer; the episode with Jethro is one in which Moses gets advice so he can work shorter hours and last longer in leadership. They are closely related passages.
Exodus 17:8-16 is a tightly structured story.
This shows that the heart of it all is about Moses getting help so that Israel can prevail. The story is not about how God fights for them as he did at the Red Sea. Since the Red Sea, God has delivered them from problems, strengthening them with water when they were weak with thirst, nourishing them with meat and bread from heaven, guiding them toward the Mountain of God. As they obtain strength, nourishment, and direction, God expects them to exercise responsibility. So in this battle the undisciplined and untried nation of slaves must begin to learn to fight for themselves.
But there is a parallel lesson going on—they must not forget to depend on the Lord. That is why Moses goes up to pray. He raises the rod of God, invoking God’s power and protection. He probably does so thinking it will be like the Red Sea, which presumably he did not stand over the whole night holding the rod while the wind blew. With Amalek, to his dismay, when he can no longer stand in symbolical position, the Amalekites prevail.
It must have been a moment of confusion up there on the mountain. It seems obvious that Moses would not have expected the battle only to last as long as he held the rod up. It must have come as a shock that he was supposed to maintain that posture of prayer for as long as it took. That was the lesson.
What God expects is sometimes puzzling to us. It is often difficult. But the lesson here is that it is not unreasonable. Moses got help, he got comfortable, he sat down, he lowered himself so that his elbows could be supported by two others and so that a long term effort with limited resources could be maintained. Isn’t that a good definition of prayer? Making the most of your limited resources to explicitly and constantly depend on the Lord?