A dog that lunges at strangers, flattens against the wall when guests arrive, or shuts down on busy streets is not being difficult. It is overwhelmed, and it has no instruction for what to do instead. Hand targeting gives it one.
The behaviour itself is small: the dog moves toward your open palm and touches it with its nose. The application is large. A dog focused on your hand is not scanning for threats. It is doing a known task with a known reward at the end, and that shift in attention is often enough to move it through a moment it would otherwise not manage.