What they ^^ said.
One of the best sounding guitars I ever had was a fairly pedestrian Fender American Standard. Alder body, Maple neck, Rosewood fretboard, whatever pickups fender pulled out of the barrel that day, etc. But, it was an absolutely magical thing. Why? Nobody knows. Tolerance stackup.
It's not as big an issue these days as it used to be, but at one time you could sit down at a large dealer and play 15 seemingly identical guitars to find the one that worked. Modern technology has evened things out quite a bit, as the human factor has more or less been designed out in manufacturing, at least with the majors. But, there's still some difference because the wood isn't controllable.
Still, some things hold true. With electrics, the body has too much mass to make much difference. The neck, on the other hand, is a biggie. Also, the pickups and bridge. Past that, it's a game of inches.