You're not grabbing it- you're pushing against it. And keep in mind, I don't have any idea if it works with other automatics.
Pushing straight against the barrel of the 9mm Military sidearm, pushes the barrel backwards- towards the hammer. Somehow, it moves the slide just enough so the trigger- hammer mechanism doesn't function. If you have a 9mm like the one the military uses, give it a try (unloaded of course). If you push against the business end of the barrel- that is, if the gun were pointed at you and you stuck out your palm (in a "halt" posture), placed your palm straight against the barrel and pushed directly against it- you can actually see it interferes with it. It pushes the hammer back a little bit further than it's supposed to be- whatever it does, it prevents the weapon from discharging (no matter how hard the guy squeezes the trigger) as long as you have it pushed back.
If you were quick enough, I suppose you could unlatch his magazine and then if you could force him to discharge his one remaining round, he'd be screwed. I found just using that method to push the barrel away from my torso/head and then using my free hand to strike seemed to be a pretty good tactic- assuming the guy was going to kill you anyway, having a hole in the hand is definitely better than one in the gut and the worst that happens is you're not quick enough and he plugs you anyway.
If you can, try it out safely. If you don't have one (9mm), go to a pawn shop or a gun show and see if you can find that model and give it a try. The magazine doesn't have to be in it. Try it either way, hammer cocked or hammer down. I don't know how to describe why the hammer can't be released, but it's like it's pinching it/putting it in a position where the trigger doesn't work. But you're right, if you didn't ID the gun correctly, you'd be screwed. We figured it would actually only be useful against another US Soldier because the probability would be highly in your favor that it would be a 9mm (against the MPs maybe?)