"The Children of Israel - the whole community - came to the Zin Desert in the first month, and the nation dwelt there in Kadesh." (Numbers 20:1)
In the previous chapter, God commanded us the statute of the red heifer, concluding the (approximately) one-and-a-third-year period starting from the Exodus. This chapter picks up the story almost thirty-eight years later, with the nation arriving in the Zin Desert, east of the River Jordan, precisely one year before entering the Land of Israel.
Those who remained were those who would inherit the Land of Israel.
We arrived in the Zin Desert on the 10th of Nissan (Targum Yonatan to Numbers 20:1) and entered Israel on the 10th of Nissan a year later (Joshua 4:19). Now begins the final approach to independence in our Land.

Those who remained were those who would inherit the Land of Israel.
We arrived in the Zin Desert on the 10th of Nissan (Targum Yonatan to Numbers 20:1) and entered Israel on the 10th of Nissan a year later (Joshua 4:19). Now begins the final approach to independence in our Land.Rashi explains the words kol ha-eidah ("the whole community") to mean eidah ha-shleimah ("the community in its entirety" or "the perfect community"), because all those who were destined to die in the desert had already died and these were the ones who had been designated for life. The Siftei Hakhamim (Rabbi Shabbetai ben Yosef Bass, 1641-1718) elucidates Rashi’s comment: "Rashi is explaining [an apparent redundancy in the text]. Since it says 'the Children of Israel,' it is obvious that this means the whole community. So he explains this to mean that those destined to die in the desert had already died."
The Ibn Ezra, a generation after Rashi, has a similar understanding: "There is no mention in the Torah of any event or prophecy, apart from the first year and the fortieth year. And the reason that 'the Children of Israel - the whole community - came' is that the generation of the desert had died, and now those who would reach the land of Canaan came."
And the Ohr HaChayyim (Rabbi Chayyim ben Attar, Morocco and Israel, 1696-1743) follows the same understanding: "It is important to realise why the Torah had to say 'the whole community', and why the term 'the Children of Israel' was not enough; the simple understanding is that 'the Children of Israel' are the whole community. Indeed, as we have seen previously, when Israel is on the level of straight and righteous, they are called 'the Children of Israel'; when they do not reach this desired level they are called 'the nation,' as when He said, 'Until when will this nation provoke Me?' (Numbers 14:11) ....Here, the Torah informs us that the whole community are categorised as 'the Children of Israel'."
Thirty-seven years and eight months previously - in our reading, two parashiot ago - the twelve spies had returned from Israel, delivered their evil report, seduced the nation into rebellion against God’s scheme and condemned the generation to die in the desert. Now, that generation had passed away and those who remained were those who would inherit the Land of Israel.
Ibn Ezra’s comment that "there is no mention in the Torah of any event or prophecy, apart from the first year and the fortieth year" is very revealing: nothing of that generation remained; they did nothing and left nothing of lasting value. They were not even considered part of "the whole community". The generation that had spurned the Land of Israel, though they had heard the Ten Commandments from God Himself and the rest of the Torah from Moshe, were discarded. The new generation, those who were indeed worthy of independence in their own Land, were "the whole community".
This new generation was worthy of entering and inheriting the Land of Israel. Perhaps the clearest indication of their worthiness was their response to an armed attack by an enemy nation. Two enemies had attacked Israel upon leaving Egypt - Egypt (Exodus 14:5-23) and Amalek (17:8-16). The first was the Egyptian army: "Pharaoh was approaching and the Children of Israel raised their eyes, and behold! Egypt was journeying after them. And they were very frightened and the Children of Israel shouted out to HaShem." (Exodus 14:10)
The Ibn Ezra comments: "It is amazing that such a huge camp of 600,000 men should be frightened of their pursuers. Why did they not fight for their lives and for their children? The answer is that the Egyptians had been Israel’s lords, and this generation that left Egypt had been trained from childhood to bear the Egyptian yoke and they had a humiliated spirit. So how could they now fight against their lords? And Israel were weakened and untrained in warfare. After all, you will see that Amalek came with a small nation, yet had it not been for Moshe’s prayer, he [Amalek] would have overpowered Israel. So HaShem, Who alone 'performs great deeds' (Job 5:9), arranged matters such that all the males of the nation that left Egypt would die: they would not have the strength to fight the Canaanites until a new generation - the generation of the desert, which had not experienced exile - would arise, who would have an exalted spirit." (Ibn Ezra's commentary to Exodus 14:13)

He did not flee from this enemy king, neither did he attempt to make peace with him.

Now, a generation later, the Israelite response to a military attack was totally different: "The Canaanite king of Arad, who dwelt in the Negev, heard that Israel was approaching by the route of the spies. And he fought against Israel and he captured a captive from it." (21:1) He captured only one captive, a slave woman (Rashi, ad loc; Yalkut Shimoni 764), "and he killed no one." (Sforno) This time around, the nation had no fear of fighting and they stood solidly behind Moshe in his response. He did not flee from this enemy king, neither did he attempt to make peace with him; he did not negotiate for the return of this captive, nor did he organise a brief foray into his territory with the intention of withdrawing as soon as possible; nor even did he call on an outside force to help settle their differences. Rather, he led Israel in battle to defeat this king, annihilated his city, and renamed it Hormah ("utter destruction") to eternalise the lesson of how the Jewish nation responds to a Jew being taken captive by an enemy army.
There would still be several stumbles in the final year before entering Israel: the people would complain of the insubstantial food, and God would send snakes to kill them (21:5-6); the daughters of Moab would seduce the men, and 24,000 would die (25:1-9). But the nation would no longer be frightened of fighting against enemies for its Land and its freedom. When Sihon, the Amorite king, attacked them, they not merely defended themselves, they captured and possessed his land, from Arnon to Jabbok to the border of the Ammonites (21:23-26).
This was the appropriate response of a generation that had left the humiliations of exile behind it, who were worthy of inheriting their Land. This is the paradigm for our generation of redemption - the generation that has entered its Land and is now on the final approach to the final Redemption.