The total defeat of the Canaanite cities, the destruction of their strongholds, and the execution of their kings represent the exact fulfillment of the command God delivered to Moses.
While the sequence of events might make it seem as though Joshua captured all these royal cities in a single, immediate sweep, the narrative is not describing an isolated moment in time. Rather, it offers a broad summary of a much longer, gradual campaign. The complete conquest of the land was a drawn-out process that actually took place over seven full years [מלבי״ם].