This actually isn’t true.
Pickups are not microphones, and are only sensitive to the overtones present on the strings themselves. There is no mechanism by which any vibration of the neck or body can interfere with the vibration of the strings, since the oscillations on the strings are transverse waves and the vibrations in the instrument are compression (longitudinal) waves.
By far, the biggest factors in the timbre of an electric guitar are the pickups, the design and method of construction, the properties of the strings themselves and how the strings are excited into oscillation.
Even then, the electric guitar is not a harmonically complex instrument, which is easily verified by plugging a guitar directly into a DAW without any amplifier modelling. The non-linearity of guitar amplifiers gives rise to most of the harmonic complexity, by harmonic distortion. I don’t mean distortion in the way guitarists mean distortion here, but in the way a physicist does; the output signal of the amplifier is very different from the input signal. Harmonic distortion happens at all times in a guitar amplifier, even with a “clean” sound.
The bridge and fret materials are most important, since the vast majority of string energy is reflected at the endpoints. Scale length matters, and contrary to “common knowledge,” there is more bass with 25.5" scale of a typical Fender than the 24.75" scale of a Typical Gibson. The neck to body joint must be well constructed or there will be significant losses in string energy.
The solid-body electric guitar was designed to not resonate, as this results in feedback when playing through powerful amplifiers.
While changing the woods used in an electric guitar (keeping the design and all other materials fixed), will change the resonant properties of the neck and body, the change to the resonances is small. Again, pickups are not microphones, and the oscillations on the strings are a transverse wave.
The woods used in electric guitars are not so drastically different, and excepting something bizarre like balsa, most woods would be perfectly acceptable construction materials for guitar-making.
Cheap guitars tend not to sound good because they have poor quality pickups and poor quality bridges.
The majority of woods used in guitar manufacture are cheap, and the few that are not are expensive due to limited supply because of deforestation and cutting caps due to treaties like CITES. Demand has also steadily increased since the the '50s and '60s too.
No woods were prohibitively expensive for use in commercial guitar manufacture when Leo Fender introduced the Telecaster and Stratocaster or when Gibson introduced the Les Paul. Leo Fender, wasn’t even consistent with the species of wood he bought for guitar manufacture in the early years, he just wanted to get suitably dry wood of any species in bulk as quickly as possible.
While mahogany is a suitable wood for guitar building (as most woods are), the primary reason why mahogany was considered a “good wood” for guitar buildng in the '50s and '60s was because large quantities of it were available at the time, and because it was inexpensive.
Gibson Les Pauls sustain because they have powerful pickups and because the heavy body is nearly acoustically dead. Resonance of the body and neck would reduce sustain. A Les Paul sounds and sustains the way it does because of the design, construction and pickups, not because of some special properties of mahogany.
A Les Paul made of alder will sound and behave like a Les Paul, and a Stratocaster made of mahogony will sound and behave like a Stratocaster (and I have, in fact, played all mahogany Strats).
People have, and they sounded just fine. Les Paul’s original “the log,” which he built himself and which was the starting point for the design of the Gibson Les Paul, was made of pine. Many early Telecasters and Stratocasters were made of pine too, as I mentioned, Leo Fender didn’t care what species of wood was used. As an example, Eric Johnon’s “Virginia,” which was his main Stratocaster from the late '80s until the late '90s, was a 1954 Strat with a pine body. The primary reasons pine isn’t commonly used in guitar building are because it dents easily and doesn’t take paint well.
Steinbergers sound different because they’re constructed differently. Most came with active EMGs from the factory, which I’m not the biggest fan of, but I’ve played others that have had the pickups changed and I thought they sounded great. Also, sustain is incredible, far more than a Les Paul.
If an electric guitar is designed to be more acoustically resonant, as in the case of a hollow of semi-hollow guitar, then wood species has more of an effect, though it’s still small, and still not predictable. Acoustic guitars are a totally different conversation.
The idea of certain species of wood being “tonewoods” for electric guitars is a nonsense claim that is not back up by any reputable, repeatable, double-blind testing with sufficient controls. Moreover, it’s not even well supported by physical reasoning.
It’s a sales pitch, and guitar companies have a vested interested in promoting this idea as truth. It is resulting in deforestation and it is the primary reason why insufficient effort has been put into researching alternative materials.