It's a variety of things working together, but weapon feedback ultimately breaks down to visual and sound design, and timing. It's the interplay of what happens and how it lines up with your expectations and your interaction. When you fire a shotgun at someone, does it sound powerful? Does the sound of your shot connecting sound like it's doing damage? Is the way their body reacts consistent with this? Is damage consistent with where you aimed?
What feels right isn't always realistic, such as the body flying backwards from a shot with a conventional firearm, but it's about generating a specific feeling that seems right. It's like when you see a fist fight in a movie vs. watching a fight in real life. It doesn't make those thudding sounds when you hit a person, but it's an audiovisual medium, and all you have are audio and visuals. If you've ever been in a fight, you know that hitting someone or getting hit feels a lot more significant that it might look for a bystander. But they can't do anything about that tactile sensation, so they use sound.
A great example of how feedback is done well is to look at Brutal Doom. I know not everyone likes it, or the guy that made it, but he solidly understands feedback in ways I didn't even realize were lacking.
I especially like his take on the plasma gun. The original, as is the case with a lot of energy type weapons in games, fails to have the same oomph that regular guns do. This is because of the ambiguity attached. We all have a pretty good idea of what a bullet does to someone, even if the feedback isn't great, so our imagination fills in some of the gaps. A plasma gun is more vague, since it doesn't exist. You have glowing blue orbs that make someone die. Kind of anticlimactic. They might as well be magic. Well he clears that ambiguity up. They burn. They char the crap out of anything they hit. Suddenly it becomes a lot more satisfying.
Not for nothing, that's also why old cartoons tended to use pew pew laser guns, instead of real guns. It was to make it more vague for the audience and censors, and let them play fast and loose with the violence level. We know what someone getting shot does, and you can't have that on a children's show. But a not-laser blast? Who the fuck knows, and they can do whatever they want with that without it seeming immediately nonsensical that he took a shot to the chest and isn't dead.