In Exodus 17 we read that Israel was attached by the Amalekites in an area called Rephidim, thought to be in the southern part of the Sinai Peninsula. From the description in Deuteronomy 25 and Exodus 17, it appears Israel did have losses.
“Remember what Amalek did unto thee by the way as ye came forth out of Egypt; how he met thee by the way, and smote the hindmost of thee, all that were feeble behind thee, when thou wast faint and weary; and he feared not God” (Deuteronomy 25:17,18).
These verses describe how the Amalekites attacked from the rear and either killed or hurt the weaker individuals who lagged behind. In the Exodus 17 account, Moses then instructed Joshua to gather men and fight against the Amalekites. Moses went to the top of a hill and while he held up his arms the battle went well for Israel. When his arms tired and dropped, the battle turned against them. This also may suggest a loss of Israeli life or injury to the fighting men.
It is interesting to consider why the Lord permitted the Amalekites to attack in the first place. Just before this incident the people bitterly complained to Moses that there was no water to drink. Verse 4 says, “And Moses cried unto Jehovah, saying, ‘What shall I do unto this people? They are almost ready to stone me.’”
The Lord then instructed Moses to strike a rock with his staff and water came pouring out. The conclusion of the matter is mentioned in verse 7. “And he called the name of the place Massah, and Meribah, because of the striving of the children of Israel, and because they tempted Jehovah, saying, ‘Is Jehovah among us, or not?’” They had experienced miracle after miracle in their deliverance from Egypt. Now they questioned whether God was with them because they were short of water. They seemed to forget what God had done for them just a couple of months earlier.
But there is another reason that God may have allowed the attack. By gaining a victory through the miraculous intervention of God, Israel was given another proof that God was still with them. Their lack of faith was reinforced, just as the arms of Moses were strengthened during the battle.