When Joshua led the Israelites into the promised land they began their conquest with a victory over the city of Jericho. If you aren’t familiar with the story you can read it here .
The next city they attacked was Ai. The outcome was different.
Joshua sent men from Jericho to Ai, which is near Beth-aven, east of Bethel, and said to them, “Go up and spy out the land.” And the men went up and spied out Ai.
And they returned to Joshua and said to him, “Do not have all the people go up, but let about two or three thousand men go up and attack Ai. Do not make the whole people toil up there, for they are few.”
So about three thousand men went up there from the people. And they fled before the men of Ai, and the men of Ai killed about thirty-six of their men and chased them before the gate as far as Shebarim and struck them at the descent. And the hearts of the people melted and became as water.