From what I understand, when you used a filled soul gem to create an enchantment, whatever soul is used is fused into the weapon. This is seen in Redguard, with the Prince's soul being put into a soul gem, so that it could be placed in his dead body (though things happen, and
Spoiler the prince ends up binding himself to Cyrus's sword and becomes Cyrus's sword
).
In addition, there is mention that Potemna's amulet is powered by the soul of a werewolf, and if one were to peer into it, one could see a werewolf running around. Though, this just may be gossip (forgot which book this was mentioned in). And then there's the Daggerfall mechanic that when an enchanted item breaks, whatever you stuffed into that item is released and is really pissed. So far, this seems to be in-lore still, and is largely unchanged
NOW! For recharging enchanted weapons, this was fuzzy until Dawnguard. Now it seems that when a filled soul gem is used to recharge an enchanted item, the soul is then sent to the Soul Carin.
As for the mechanics of soul trapping, it's a spell that makes it so that a soul doesn't go right to the Dreamsleeve, or whatever the person bound themselves to, and heads right into the soul gem. If I had to say, it's creating a path of least resistance of the soul and binding it to the soul gem. From there, the soul is stuck in the soul gem (seen in Azura's quest in Skyrim, and the named Soul Gem mechanic in Morrowind), until used. Further shown in Morrowind as whomever you stuffed inside a soul gem is named in the soul gem. So, if you stuffed Eno Hlaalu in a soul gem, the soul gem would say "Grand Soul Gem (Eno Hlaalu)".