Why did Israel undergo circumcision before entering the physical battles in Canaan?
Israel underwent circumcision because the covenant relationship with Jehovah had to be consummated first. God prioritized spiritual preparation over military readiness, even at Jericho's doorstep. This rite prepared them spiritually for the coming physical battles and rolled away the reproach of Egypt.
The context explains that, so far as God was concerned, it was more important for Israel to fulfill her covenant relationship with Jehovah, which had been demanded from day one to Abraham—circumcision. First things first. Even at the doorstep of a mortal enemy, Jericho, God literally laid the nation in a useless position, incapacitating the whole nation before the enemy. They went through the rite of circumcision to prepare them spiritually for the physical battles that were coming, because the covenant relationship had to be consummated. After they were circumcised, they stayed in their places until they were whole or healed. The Lord then told Joshua, 'This day have I rolled away the reproach of Egypt from off of you,' and the place was called Gilgal.