Gammerz Hollywood 🙂
If a gun runs out of ammo, the firing mechanism will cycle with the energy from your pull of the trigger but there’s nothing for the firing pin to connect with, so you do get a ‘click’ when the firing pin hits a stop.
if a gun actually jams it depends a bit, but you either get nothing at all because the mechanism can’t pull the pin back, or if the mechanism is so heavy, you just can’t pul the trigger back enough to make it cycle so it feels ‘locked’.
In reality, you don’t want a gun which is jammed to cycle. That runs the risk of ruining the mechanism or, at worst, of a round actually going off while being jammed in the chamber, which would probably ruin the weapon at a bare minimum and might even cause the thing to effectively explode in your hand.
Thing is, obviously, with films you need to demonstrate to the audience that the gun the hero is holding isn’t working any more, and someone saying so just looks crap, so they always put a ‘click’ in to make it obvious even if the jam actually wouldn’t make a noise.
Guns, even modern automatic weapons (apart from a couple of notable experimental type things) are actually mechanically REALLY simple. Even the complicated ones are basically ‘one stroke engines’. They are pretty much literally just a piston or a ‘clockwork’ mechanism to push cartridges around.
There’s a quite interesting YouTube channel - which doesn’t seem to have shown up in my feed recently, so maybe it’s dead, but anyway - called ‘Forgotten weapons’, run by a guy (American, obv) who mainly collects WWII period guns but does include some more modern crazy prototypes and stuff. The interesting bit is if he’s looking at say a WWII sniper rifle, he’ll generally field strip it and go over how the firing mechanise works. You’d be surprised how many even fairly modern guns are effectively just ‘a bit of sliding metal on a spring’.