Then Amalek came and fought with Israel at Rephidim. So Moses said to Joshua, "Choose for us men, and go out and fight with Amalek. Tomorrow I will stand on the top of the hill with the staff of God in my hand." So Joshua did as Moses told him, and fought with Amalek, while Moses, Aaron, and Hur went up to the top of the hill. Whenever Moses held up his hand, Israel prevailed, and whenever he lowered his hand, Amalek prevailed. But Moses' hands grew weary, so they took a stone and put it under him, and he sat on it, while Aaron and Hur held up his hands, one on one side, and the other on the other side. So his hands were steady until the going down of the sun. And Joshua overwhelmed Amalek and his people with the sword. Then the LORD said to Moses, "Write this as a memorial in a book and recite it in the ears of Joshua, that I will utterly blot out the memory of Amalek from under heaven." And Moses built an altar and called the name of it, The LORD Is My Banner, saying, "A hand upon the throne of the LORD! The LORD will have war with Amalek from generation to generation."
Exodus 17:8-16
There are two ways of interpreting Israel's encounter with Amalek, and both are valid in the insight they give into spiritual issues, although we hardly see that they can both at the same time apply to Israel. One is to say that Amalek followed the murmuring, the other that Amalek followed the blessing. Let us look at these in turn. Israel, it is clear, were at this time out of joint with God, their hearts disaffected against Him and His appointed servant, Moses, and such a spirit certainly gives place to the devil, in individuals and in fellowships alike, and opens the door to his unwelcome attentions. And once he makes his way in, it can prove a very costly and painful matter before he is eventually dislodged again, as Moses was to prove here. What we must learn is that when we withdraw ourselves from fellowship with God through our sin we also withdraw ourselves from His protection. We ask for trouble, and we get it. This is certainly what Israel experienced at Rephidim.