הֲיִֽגְאֶה־גֹּ֭מֶא בְּלֹ֣א בִצָּ֑ה יִשְׂגֶּה־אָ֥חוּ בְלִי־מָֽיִם׃
קען אױסװאַקסן ראָר אָן אַ זומפּ?קען גרױס װערן טײַכגראָז אָן װאַסער?
Mekhilta DeRabbi Yishmael
(Exodus 17:8) "And Amalek came": This verse is recondite and is explicated by (Iyyov 8:11) "Can the rush grow without swamp? Can grass grow without water?" So, Israel without Torah. And because Israel separated from Torah, therefore, the foe (Amalek) came upon them. For the foe comes only by reason of sin and transgression. Thus, "And Amalek came, etc."
Midrash Tanchuma
Then came Amalek and fought with Israel in Rephidim (Exod. 17:8). R. Eliezer the son of Hisma said: This verse should be understood and interpreted in relation to the verse quoted in Job: Can the rush shoot up without mire? Can the reed grass grow without water? (Job 1:11). Just as that is impossible, so is it impossible for Israel to survive unless the people devote themselves to the law. It was because Israel turned away from the law that the enemy attacked them. Indeed, the enemy attacked them only as a consequence of their sins and transgressions. Hence it says: Then came Amalek.