"... and the walls came tumbling down"
No they didn't. There is no archaeological evidence that anything like that ever happened in Jerico, one of the oldest communities ever.
The work of archaeolgist Kathleen Kenyon, in her excavation of the city of Jericho determined that the walls of Jericho were destroyed around 2300 B. C., about the same time that Ai was destroyed. Apparently, then, legends developed to explain the ruins of ancient cities, and biblical writers recorded them as tales of Joshua's conquests.