Even two of the same model of guitar can sound different. One will be dead sounding, the other will be alive.
Dead and alive may be a bit extreme but you are 100% correct. And it's overwhelmingly because of the wood barring any obvious major defect with anything else. I don't even bother plugging in guitars when I'm shopping.
Every chunk of wood is different. Density level and resonance point being two biggies. First off the wood has to be allowed to dry naturally (or sped up via dryers). Once the body is ready you need to marry it with a neck that's going to work with it and not against it. This is done by the smaller guys via 'tap-toning'. With the big guys is usually just a happy accident. (best strat I ever owned many moons ago was a MIM one that only cost me a few hundred bucks. The hardware and pickups were on the lower end but the setup was sound and the thing was alive acoustically. Almost as loud as an acoustic! Strum an open E and the thing would ring forever)
Re: Drying - if you've ever played a Norlin era Les Paul you know what happens if the wood isn't allowed to dry - might as well strap a boat anchor over your shoulder. Super heavy and dead as a door nail. The age of the wood matters too because of the sap than runs through it. It can take decades after a board is cut before it's finally hardened and crystallyzed. The past 10 years the big deal in boutique guitars is re-claimed lumber. Boards that are cut from really old buildings or lumber that's been dredged from the bottom of rivers.
One example: https://www.crainsdetroit.com/…rs-find-resonance-detroit
On the flip side, grab the deadest cheap Les Paul you can find, plug it into a Marshall half stack with everything dimed, and you'll find glory!
Quick note for anyone that might not know. Brain May's legendary Red Special is made from wood cut from a centuries old fireplace mantel.