4 Now this is why he did so: All those who came out of Egypt—all the men of military age—died in the wilderness on the way after leaving Egypt.
References for Joshua 5:4
5 All the people that came out had been circumcised, but all the people born in the wilderness during the journey from Egypt had not.
6 The Israelites had moved about in the wilderness forty years until all the men who were of military age when they left Egypt had died, since they had not obeyed the LORD. For the LORD had sworn to them that they would not see the land he had solemnly promised their ancestors to give us, a land flowing with milk and honey.
7 So he raised up their sons in their place, and these were the ones Joshua circumcised. They were still uncircumcised because they had not been circumcised on the way.