Dynamite can be thrown short or long distance to create a high damage explosion that will kill most robots at once, as well as attract those nearby with the sound.
As Dynamite is relatively rare and valuable, it is best to maximize its effect by using it on large groups or damage resistant robots.
Since the Squire doesn't become aggressive to you unless you attack him first or loot his town, you can throw a stick of Dynamite under his feet, step back, and he will be destroyed, allowing you to loot his body.
Dynamite can also be used against the guards of fragment locations, especially those with little or no cover in the surrounding area, making a firefight ill-advised, or which are surrounded by dense vegetation, which facilitates your approach and proximity to the location to ensure accurate throwing and makes targeting of the robots with your firearms more difficult. Make sure your targets are close to the stick, as the blast radius is fairly small.