Sure pigs are intelligent but a pig that's never seen a gun before doesn't know it's going to die.
This doesn't mean that any pig could articulate "I'm going to die". That isn't necessary. Nearly every ungulate (maybe not moose?) has a built-in mortal fear ready to surface at any time. New events, or repeated events with bad associations, bring out that fear. It takes a great deal of training to relax that.