Aliya Summary: The Israelites journeyed further and as they arrived in Refidim their drinking water ran out again. The Israelites complained, and G‑d instructed Moshe to smite a certain rock with his staff. Water came pouring out of the rock and the people drank. The Amalekites then came and attacked the Israelites. Moshe directed his student Joshua to assemble an army and battle Amalek. Joshua did so, and the Israelites were victorious—aided by Moshe’s prayer atop a mountain. G‑d told Moshe to record in the Book that He will “surely erase the memory of Amalek from under the heavens.”
What made Amalek so evil was that they exploited the (perceived) weakness of the Israelites to try and destroy them. While recording in the book to erase their memory sounds like an oxymoron, the point was to remember to never prey on the weak, for we were once weak too.