Another interpretation of (Deuteronomy 25:18) "all who were lagging behind you": Rabbi Judah and Rabbi Nehemiah and the Rabbis differed. Rabbi Judah said: They said, "If He is master over all deeds the way that He is master over us, we will serve Him; and if not, we will not serve Him." And Rabbi Nehemiah said: They said, "If He supplies enough of our food for us, like a king who dwells in a province and the province lacks nothing at all, we will serve Him; and if not, we will rebel against Him." And the Rabbis said: They said, "If we speak in our hearts and He knows what we are speaking, we will serve Him; and if not, we will rebel against Him." Rabbi Berekhiah said, in the name of Rabbi Levi: In their heart they were speaking, and the Holy One, blessed be He, gives them their request. And what is the reason? "And they tested God in their heart" etc. (Psalms 78:18). See what is written there (Psalms 78:29): "And they ate and were exceedingly sated."
Why Amalek Struck the Stragglers Who Doubted God's Rule
Midrash Tanchuma Buber, Ki Teitzei 15:2
[ד"א כל הנחשלים אחריך. רבי יהודה ורבי נחמיה ורבנן, ר' יהודה אמר, אמרו אם רבון הוא על כל המעשים כדרך שהוא רבון עלינו נעבדנו, ואם לאו לא נעבדנו, ור' נחמיה אמר, אמרו אם מספיק הוא לנו מזונותינו כמלך שהוא שרוי במדינה ואין המדינה חסרה כלום נעבדנו, ואם לאו נמרוד בו, ורבנין אמרין אמרו אם מסיחין אנו בלבבינו והוא יודע מה אנו מסיחין נעבדנו, ואם לאו נמרוד בו, ר' ברכיה [בשם ר' לוי] אמר בלבם היו מסיחין, והקב"ה נותן להם שאלתם, ומה טעם וינסו אל בלבבם וגו' (תהלים עח יח), ראה מה כתיב תמן, ויאכלו וישבעו מאד (שם שם כט) ].