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. 
This enemy of Israel bore the name Amalek to denote the rapidity with which he moved against Israel, for like a swarm of locusts he flew upon them; and the name furthermore designates the purpose of this enemy, who came to suck the blood of Israel.  This Amalek was a son of Eliphaz, the first-born son of Esau, and although the descendants of Jacob had been weaker and more insignificant in earlier times, Amalek had left them in peace, for he had excellent reasons to delay his attack. God had revealed to Abraham that his seed would have to serve in the land of the Egyptians, and had put the payment of this debt upon Isaac, and after his death, upon Jacob and his descendants. The wicked Amalek now said to himself, "If I destroy Jacob and his descendants, God will impose the Egyptians bondage upon, me, grandson of Esau, descendant of Abraham." Therefore he kept himself in restraint as long as Israel dwelt in Egypt, but only after the bondage predicted to the seed of Abraham had been served in full, did he set out to accomplish the war of annihilation against Israel, which his grandfather Esau had enjoined upon him. 
No sooner had he heard of Israel's departure from Egypt, then he set out against them and met them by the Red Sea. There, indeed, he could work them no ill, for Moses uttered against him the Ineffable Name; and so great was his confusion, that he was forced to retreat without having effected his object.  Then, for some time, he tried lying hidden in ambush, and in this wise molesting Israel, but as length he gave up this game of hide-and-seek, and with a bold front revealed himself as the open enemy of Israel. Not alone, however, did he himself declare war upon Israel, but he also seduced all the heathen nations to assist him in his enterprise against Israel. Although these declined to war upon Israel, fearing that they might have to fare like the Egyptians, they agreed to the following plan of Amalek. He said: "Follow my expedition. Should Israel conquer me, there will still be plenty of time for you to flee, but should success crown my attempt, join your fate to mine, in my undertaking against Israel." So Amalek now marched from his settlement in Seir, which was no less than four hundred parasangs away from the encampment of the Jews; and although five nations, the Hittites, the Hivites, the Jebusites, the Amorites, and the Canaanites, had their dwellings between his home and the camp of the Jews, he insisted upon being the first to declare war upon Israel.
God punished Israel, who had shown themselves an ungrateful people, by sending against them an enemy that was ungrateful, too, never recalling that he owed his life to the sons of Jacob, who had had him in their power after their brilliant victory over Esau and his followers. 
In his expedition against Israel he made use of his kinsman. Before going over to open attack, he lured many unsuspecting Jews to death by his kindly words. He had fetched from Egypt the table of descent of the Jews; for every Jew had there to mark his name on the bricks produced by him, and these lists lay in the Egyptian archives. Familiar with the names of the different Jewish families, Amalek appeared before the Jewish camp, and calling the people by name, he invited them to leave the camp, and come out to him. "Reuben! Simeon! Levi! etc.," he would call, "come out to me, your brother, and transact business with me."
Those who answered the enticing call, found certain death at his hands; and not only did Amalek kill them, but he also mutilated their corpses, following the example of his grandsire Esau, by cutting off a certain part of the body, and throwing it toward heaven with the mocking words, "Here shalt Thou have what Thou desirest." In this way did he jeer at the token of the Abrahamic covenant.
So long as the Jews remained within the encampment, he could, of course, do them no harm, for the cloud enveloped them, and under its shelter they were as well fortified as a city that is surrounded by a solid wall. The cloud, however, covered those only who were pure, but the unclean had to stay beyond it, until they were cleansed by a ritual bath, and these Amalek caught and killed. The sinners, too, particularly the tribe of Dan, who were all worshippers of idols, were not protected by the cloud, and therefore exposed to the attacks of Amalek. 
Moses did not himself set out to battle against this dangerous foe of Israel, but he sent his servant Joshua, and for good reasons. Moses knew that only a descendant of Rachel, like the Ephraimite Joshua, could conquer the descendant of Esau. All the sons of Jacob had taken part in the unbrotherly act of selling Joseph as a slave, hence none of their descendants might stand up in battle against the descendant of Esau; for they who had themselves acted unnaturally to a brother, could hardly hope for God's assistance in a struggle with the unbrotherly Edomites. Only the descendants of Joseph, the man who had been generous and good to his brothers, might hope that God would grant them aid against the unbrotherly descendants of Esau. In many other respects, too, Joseph was the opposite of Esau, and his services stood his descendants in good stead in their battles against the descendants of Esau. Esau was the firstborn of his father, but through his evil deeds he lost his birthright; Joseph, on the other hand, was the youngest of his father's sons, and through his good deeds was he found worthy of enjoying the rights of a firstborn son. Joseph had faith in the resurrection, while Esau denied it; hence God said, "Joseph, the devout, shall be the one to visit merited punishment on Esau, the unbelieving." Joseph associated with two wicked men, Potiphar and Pharaoh, yet he did not follow their example; Esau associated with two pious men, his father and his brother, yet he did not follow their example. "Hence," said God, "Joseph, who did not follow example of wicked men, shall visit punishment upon him who did not follow the example of pious men." Esau soiled his life with lewdness and murder; Joseph was chaste and shunned bloodshed, hence God delivered Esau's descendants into the hands of Joseph's descendants. And, as in the course of history only the descendants of Joseph were victorious over the descendants of Esau, so will it be in the future, at the final reckoning between the angel of Esau and the angels of the Jews. The angel of Reuben will be rebuffed by the angel of Esau with these words, "you represent on who had illegal relations with his father's wife"; the angels of Simeon and Levi will have the listen to this reproof, "You represent people who slew the inhabitants of Shechem"; the angel of Judah will be repulsed with the words, "Judah had illicit relations with his daughter-in-law." And the angels of the other tribes will be repulsed by Esau's angel, when he points out to them that they all took part in selling Joseph. The only one whom he will not be able to repulse will be Joseph's angel, to whom he will be delivered and by whom he will be destroyed; Joseph will b the flame and Esau the straw burned in the flame.