Ever hear of OJ's book
Invalid Link Removed? I'm not saying it does or it doesn't, but if it does, here's how it would go.
The string vibrates in the magnetic field, and that vibration is what we end up hearing. But if the string were dampened mechanically, this would change the vibration of the string and therefore what gets amplified would be different. The mechanical system of the string is not perfectly separated from the body, because bridge and nut/zero fret design just isn't perfect (and what might be perfect from a mechanical standpoint might be seen by players as sounding awful).
So the string has some mechanical linkage to the body, and different materials dampen different frequencies more or less. So I think instead of the "resonance" that you hear a lot, it would be more apt to talk about the dampening of the body and bridge, or in other words, the wood doesn't add anything, it only subtracts.
In an extreme example, imagine that the bridge and nut were made of buttered toast. This would dampen nearly all frequencies and would make the bass have almost no sustain and sound awful, barely even producing an audible note. At the other extreme, imagine a string clamped to some ridiculously hard and dense imaginary material with almost zero dampening in any frequency. It would impart no color of its own, and would allow for much more sustain, but because we're used to wood it would sound to us like a very strangely colored sound.
In between these extremes is wood, and the particular ways that woods dampen particular frequencies would,
if I did it, and I'm not saying I did, contribute to the "tone" and sustain profile that people say they hear.
I'm only getting into this because I'm hoping it won't be a "typical" tone thread.