As a punishment because they had not had sufficient faith in God, and had doubted whether He could fulfill all their wishes, and had grown negligent in the study of the Torah and in the observance of the laws, God turned Amalek against them during their sojourn in Rephidim, where they had committed these sins. God dealt with them as did that man with his son, whom he bore through the river on his shoulders.
Whenever the child saw something desirable, he said, "Father, buy it for me," and he fulfilled the child's wish. After the son had in this way received many beautiful things from his father, he called to a passing stranger with these words, "Hast thou perhaps seen my father?" Then, indignantly, the father said to his son: "O thou fool, that sittest on my shoulder! All that thou didst desire, did I procure for thee, and now dost thou ask of that man, 'Hast thou seen my father?'"
Thereupon the father threw the child off his shoulder, and a dog came and bit him. So did Israel fare. When they moved out of Egypt, God enveloped them in seven clouds of glory; they wished for bread, and He gave them manna; they wished for flesh, and He gave them quails. After all their wishes had been granted, they began to doubt, saying, "Is the Lord among us, or not?"
Then God answered, "You doubt My power; so surely as you live shall you discover it; the dog will soon bite you." Then came Amalek.