Moments before entering the Land of Israel, a profound national transition takes place. The new generation must enter the covenant of Abraham. The primary approach among commentators explains the historical circumstances that necessitated a mass circumcision at this specific time, as well as why Joshua, rather than the fathers of the families, led the initiative. The older generation of men who had left Egypt—those who were capable and responsible for circumcising their own sons—had already died in the wilderness [מצודת דוד, רד״ק, אברבנאל]. Joshua remained the sole surviving leader of that mature generation, spared through the prayers of Moses, and thus it fell upon him to prepare the youth for their entry into the land [אלשיך].
Another approach suggests that Joshua also had to actively persuade the nation through direct dialogue [רש״י, צוארי שלל, צאינה וראינה, חומת אנך]. Sensing some hesitation among the people [חומת אנך], Joshua delivered a sharp and poignant message. He clarified that they could not inherit the land while uncircumcised, as the original promise to Abraham was strictly conditional upon maintaining this covenant [רש״י]. Joshua explained that this act was a declaration of accepting God's kingship and served as the true deed of ownership to the land, effectively canceling the ancient decree of exile [צוארי שלל]. He further emphasized the unique holiness of the Land of Israel, a place under God's direct rule that does not tolerate sin; the covenant would sanctify the people and protect them from immorality in the Holy Land [צאינה וראינה]. Finally, he warned them that refusing the Commandment would saddle them with the sins of their fathers who had caused the delay in the desert, whereas fulfilling it now would bring peace to their ancestors [חומת אנך].
The commentators agree that the entire generation that originally left Egypt was already circumcised. This proves that they had maintained the Commandment even in exile and properly prepared for the Passover sacrifice [רד״ק, אברבנאל]. Yet, they perished in the wilderness because they failed to completely cleanse themselves from the corrupt mentalities and impurities of Egypt, a failure that culminated in the sin of the spies and their ultimate punishment [מלבי״ם, אברבנאל]. Therefore, the individuals undergoing the procedure now were those born in the desert or who were very young during the exodus [רד״ק, שטיינזלץ].
This raises a natural question as to why these children were not circumcised during their forty years in the wilderness. The primary reason was the physical danger of travel. The Israelites journeyed and camped solely by God's command, often with no prior warning. Embarking on a sudden desert journey with a healing infant posed a severe risk. Because of this valid medical concern, the court of Moses could not compel the people to perform the Commandment [מלבי״ם, אברבנאל]. Still, select pious groups, such as the tribe of Levi, relied entirely on God's protection and circumcised their sons despite the perilous conditions [מלבי״ם]. Now, however, safely encamped in Gilgal on the threshold of the land, the nation could remain securely in place until fully healed, finally removing the obstacle to fulfilling the covenant [אברבנאל].