Midrash Rabbah - Numbers XVI:18

18. AMALEK DWELLETH IN THE LAND OF THE SOUTH (XIII, 29). What reason did they see for commencing with Amalek? The case is like that of a child who misbehaved and was beaten with a strap. Whenever people wanted to frighten him they used to remind him of the strap with which he had been beaten. In the same way Amalek was Israel's evil strap.3 What reason did Amalek see for stationing himself on the boundary in the way of Israel's entry into the land? His grandfather Esau told him to do so, namely, to forestall them on the road, so he moved from his position4 and stationed himself in the way; as it says, Then the Amalekite and the Canaanite... came down, and smote them and beat them down, even unto Hormah (ib. XIV, 45).

Midrash Rabbah - Numbers XIX:20

20. AND WHEN ALL THE CONGREGATION SAW THAT AARON WAS DEAD (XX, 29). When Moses and Eleazar descended from the mountain, all the congregation assembled against them and said to them: ' Where is Aaron?’ They answered them: ‘He is dead.’ The others objected: ' How could the Angel of Death strike him? He was a man who had withstood the Angel of Death and had restrained him; as it is written: And he stood between the dead and the living and the plague was stayed (Num. XVII, 13)! If you bring him back, well and good; if not, we shall stone you! ' Thereupon Moses resorted to prayer, and said: ‘Sovereign of the Universe! Deliver us from suspicion.’ Straightway the Holy One, blessed be He, opened the cave and showed Aaron to them; as is borne out by the text, AND WHEN ALL THE CONGREGATION SAW THAT AARON WAS DEAD. What is written after this? AND THE CANAANITE THE KING OF ARAD WHO DWELT IN THE SOUTH, HEARD THAT ISRAEL CAME BY THE WAY OF ATHARIM; AND HE FOUGHT AGAINST ISRAEL (XXI, 1). You find that when Aaron died, the clouds of glory departed, and Israel appeared like a woman whose hair has been uncovered. Who was the king of Arad? It was Amalek; as is borne out by the text, Amalek dwelleth in the land of the South; and the Hittite, and the Jebusite, and the Amorite, dwell in the mountains; and the Canaanite dwelleth by the sea, and along by the side of the Jordan (Num. XIII, 29). Amalek dwelt in the gap on the border, and when he heard that Aaron was dead and that the clouds of glory had departed he straightway attacked them. BY THE WAY OF ATHARIM. ATHARIM1 alludes to the Great Scout2 who explored the way for them; as it says, And the ark of the covenant of the Lord went before them three days’ journey, to seek out a resting-place for them (ib. X, 33). AND HE FOUGHT AGAINST ISRAEL. If he was in reality Amalek why was he called by the name of Canaanite? For this reason: Israel was forbidden to fight against the children of Esau; as it says, Contend not with them; for I will not give you of their land, no, not so much as for the sole of the foot to tread on; because I have given Mount Seir unto Esau for a possession (Deut. II, 5). Now when Amalek3 came and waged war against them, a first time and a second time, the Holy One, blessed be He, said to them: ‘This nation is not forbidden to you as are the children of Esau. They are like Canaanites to you, of whom it says, Thou shalt utterly destroy them’ (ib. XX, 17). This is the reason why they were called Canaanite. The Amalekites were ever a strap of chastisement for Israel. You find that as soon as they said, Is the Lord among us? (XVII, 7),4 Came Amalek (ib. 8). When They said one to another: Let us make a captain, and let us return into Egypt (Num. XIV, 4), Then the Amalakite and the Canaanite... came down (ib. 45). And here, THE CANAANITE, THE KING OF ARAD... HEARD. You find that when Aaron died, the Amalekites went out against them and they had to turn back seven stages. This may be inferred from the fact that it says, And the children of Israel journeyed from Beeroth-bene-jaakan to Moserah; there Aaron died (Deut. X, 6). Now, did Aaron die there? Did he not die on Mount Hor; as it says, Aaron died there in the top of the mount (Num. XX, 28)? The Scriptural verses1 prove that these2 represent seven stages backwards. This serves to teach you that they had turned back.