Exodus 17 has two distinct parts. In verses 1 – 7, contains another complaint from the people about the lack of water. In verses 8 – 16, there is a military confrontation with the Amalekites. Both events occurred at a place called Rephedim, which was probably not far from Mt. Sinai (Horeb).
After the provision of food (manna and quail) had been established, the Israelites continued their trek toward Mt. Sinai, also called Horeb, moving to a place called Rephedim. Here, they found no water to drink. The people complained to Moses, who in turn cried out to the LORD for guidance. The LORD told him to go to a rock at Horeb and strike it with the same staff that he used to strike the Nile River in Egypt. The people got water, and the location received two names – Massah and Meribah.
Another important event happened while the Israelites were at Rephadim. The Amalekites attacked them (8 – 16). Moses ordered Joshua to take an army to repel the attack. He would stand on a hill overlooking the battle with the staff of God. When he raised the staff into the air, the Israelites prevailed, and if he lowered the staff, the Amalekites got the better of the Israelites. When Moses’ arms got tired, his assistants propped up his arms until sunset, allowing Joshua to win the battle. The LORD then instructed Moses to write the account of the battle as a memorial to the fact that He would eliminate the Amalekites from the earth. Moses in turn built an altar to the LORD and working of His will concerning the Amalekites.