A military siege often hinges on finding a single vulnerability in an otherwise impenetrable fortress. As the warriors of the tribe of Joseph lay siege to the city of Luz, they face exactly this challenge. Scouts from the tribe are sent to observe the city [מצודת דוד, ביאור שטיינזלץ]. They establish a camp around the perimeter to prevent any residents from escaping. Even though these guards form only a small group, with the rest of the army patrolling elsewhere, they operate with remarkable courage [מלבי״ם]. Their primary strategy is to wait patiently for someone to emerge from the city so they can question him [מצודת דוד].
When a man finally leaves, the guards seize the moment and ask him to reveal the entrance [מצודת ציון, ביאור שטיינזלץ]. They are not looking for the main, obvious gate, but rather a hidden, secret passageway [מלבי״ם]. According to ancient tradition, the city was named Luz because it was completely sealed off with no visible opening, resembling a closed hazelnut. The only way into the city is through a concealed cave. A hollow hazel tree stands at the mouth of this cave, and anyone wishing to enter the city has to pass directly through the hollow trunk and into the cave beyond [רש״י, רד״ק].
In exchange for this crucial intelligence, the scouts make a promise of true kindness, which is to be fulfilled once the city is conquered [מצודת דוד]. While the man's cooperation would guarantee his own survival regardless, the guards pledge a genuine act of grace that goes far beyond simply sparing his life. This promise is ultimately honored when the conquerors grant freedom not only to the man himself but to his entire family [חומת אנך].