Then came Amalek. See on Genesis 21:25 and Judges 5:11. Amalek came to fight for the water. Compare Deuteronomy 25:17; Deuteronomy 25:18. Amalek came behind and attacked the rear, and he "feared not God", Deuteronomy 25:8.
Amalek, Figure of speech Synecdoche (of Part), App-6, put for Amalekites. At Rephidim, they got water plus Amalek; at Meribah, water plus Edom.