Shemot17:11

וְהָיָה כַּאֲשֶׁר יָרִים מֹשֶׁה יָדוֹ וְגָבַר יִשְׂרָאֵל וְכַאֲשֶׁר יָנִיחַ יָדוֹ וְגָבַר עֲמָלֵק׃

And it came to pass, when Moshe held up his hand, that Israel prevailed, and when he let down his hand, Amalek prevailed.

Shemot 17:11

וְהָיָה כַּאֲשֶׁר יָרִים

Shemot / Exodus 17:11 · Sod

Shemot 17:11

וְהָיָה כַּאֲשֶׁר יָרִים מֹשֶׁה יָדוֹ וְגָבַר יִשְׂרָאֵל וְכַאֲשֶׁר יָנִיחַ יָדוֹ וְגָבַר עֲמָלֵק׃

And it came to pass, when Moshe held up his hand, that Israel prevailed, and when he let down his hand, Amalek prevailed.

Sod סוֹד

Amalek within

Sometimes strength suddenly leaves you, and what you handled easily yesterday gets the upper hand today. Kedushat Levi teaches: everyone has his own Amalek, and everyone has Moshe's (Moses') hand too.

Kedushat Levi: in every heart an evil part is hidden, called Amalek. The strength of Israel is in the mouth, in Torah and prayer: while the heart burns for the Eternal, evil has no power over it. When the hands slacken (רָפוּ), Amalek comes at once. Moshe's "hand" is this strength: when a person raises it, Israel prevails, and when he lowers it, Amalek prevails.

How Kedushat Levi explain it

Kedushat Levi "Remember what Amalek did to you, and you were faint and weary, and he did not fear the Almighty" (Devarim / Deuteronomy 25:17–18)

It seems the matter is this. Not only are the descendants of Israel commanded to wipe out Amalek, a descendant of Esav (Esau), but every person of Israel must wipe out the evil part that is called by the name Amalek and is hidden in his heart. For as long as the seed of Amalek is in the world, and since a person too is a small world, Amalek, the power of evil, is in every person. It stirs each time to lead a person to sin, and this is why the Torah says "remember".

And the strength of the descendants of Israel is only in the mouth: "the voice is the voice of Yaakov (Jacob)" (Bereshit / Genesis 27:22), in Torah and prayer. When a person has this strength and his heart always burns for the Eternal, blessed is He, no evil can rule over him. But when a person lets go of this strength, at once "they journeyed from Rephidim" (רְפִידִים), that is, their hands (יְדֵיהֶם) slackened (רָפוּ). And at once "Amalek came": at once evil dwells with him.

But when a person holds at least to fear, fears Him, blessed is He, and does not transgress His commandments, he at least does not come to sin. And this is what is written: "and you were faint and weary", you lack the strength of the descendants of Israel, whose hands slackened in the service of the Eternal, "and he did not fear the Almighty". And therefore remember well, so that the power of Amalek does not make you stumble. And this is what is written: "blot out": blot out from your heart the root of evil and subdue it under the good.

And this is what is written: "And it came to pass, when Moshe held up his hand" (Shemot / Exodus 17:11). That is, his strength, which is called "hand": when a person raises this strength, then "Israel prevailed". And when he lowers this strength, then, God forbid, Amalek "prevailed".

Takeaway

Wordplay: "Rephidim" (רְפִידִים), the place of the battle, is read as "their hands (יְדֵיהֶם) slackened (רָפוּ)". The sages say: there their hands slackened in Torah, and so Amalek came (Sanhedrin 106a).
The words "they journeyed from Rephidim" come later in the Torah (Shemot / Exodus 19:2). Before the battle it says: "And Amalek came and fought with Israel in Rephidim" (Shemot / Exodus 17:8). Kedushat Levi quotes the verse from memory.
A person is a small world (עוֹלָם קָטָן): everything in the great world is also in a person. So the war with Amalek is waged within as well.
Rabbi Levi Yitzchak of Berditchev gave this homily on Purim. On the Shabbat before Purim the passage "Remember what Amalek did to you" is read (Devarim / Deuteronomy 25:17–19).