Bringing the defeated kings before Joshua serves as a powerful public display of absolute victory and submission. Joshua gathers the entire nation and specifically calls forward his military officers, the important commanders who hold authority and marched alongside him [מצודת ציון, ביאור שטיינזלץ]. He commands these leaders to place their feet upon the necks of the captured kings.
This physical gesture is a ceremonial act symbolizing complete surrender [ביאור שטיינזלץ]. The display has a clear strategic purpose: to strike fear into the remaining enemies in the land, ensuring they will be too terrified to fight the Israelites. Additionally, this dramatic moment, along with the subsequent hanging of the kings and their final sealing inside a cave under massive stones, is intended to serve as a permanent reminder to the Israelites of the great miracle that occurred during this war [רלב״ג].