A guitar is all about the sum of its 'parts' - whether Acoustic or Electric. If 'everything' is perfect, then your guitar will Sustain on every note because the 'energy' you put in is not being 'lost'.
Species of woods is not as important as the 'treatment' of those woods, making sure they don't have too much moisture so will resonate better and longer, including the sap crystallising too - so it starts with ensuring that you are using the best materials. People may laugh at Paul 'tapping' neck blanks and listening to them 'ring' - but that is an example of transfer of energy from being tapped to vibrate and ring out - not 'lost' or dampened by too much moisture in it.
Everything matters because anything can 'sap' some of that energy you are putting in, dampen it resonating as long and so it doesn't sustain as long as other instruments. The best sustaining guitars are those that lose less energy in their 'system'.