After the Children of Israel are told in the Book of Numbers that they must delay a generation before invading Canaan, a group of them decide to go and attack regardless. They called the ma’apilim. Those who dare, but not in a good sense. Moses warns them not to and tells them in advance they will not succeed. They go ahead nevertheless and are roundly defeated. The Canaanites and the Amalekites come down the mountain and defeat them pursuing them all the way to Horma.
Years later as the Israelites approach their destination there is another battle (Numbers 21.1.). The Canaanite King of Arad attacks Israel. Captures some. Israel fights back. They destroy him and call the place Horma.
This week when Moses repeats the story he calls them zeydim, arrogant. And this time he says it was the Emorites who pursued them like bees all the way to Horma.
There is one other reference to Horma in the Bible. This one in the days of the Judges, the tribes of Judah and Simon attack the Canaanites and take over their land and re-name the place Horma even though the area is described as Safed, Tzfat, in the north of Israel.
There are two answers. One is that you often find the same name applied to different places in the Bible. Rama is one, Carmel is another that come immediately to mind. Just as names overlap but may refer to the same people, Emorites, Canaanites and Amalekites turn up in different locations. There was a lot of land and population swapping at that time. But it could simply be that the disaster of the first attempt on Horma made such a profound impression that when the Israelites eventually succeeded, they called the pace where they won, after the original catastrophe as a symbol of victory.