They all contribute to different extents case by case. It depends on the specific system.
The component used with the worst dynamic range is teh bottleneck and is responsible for whatever dynamics you hear or not. Improve that piece with one that does dynamics better and your dynamics should improve the most.
In most cases, it might be either speaker, amp, pre-amp or source that is the bottleneck. With digital sources, nowadays I think most decent digital sources are less likely than the others to be the bottleneck. I think the same is true in general regarding ICs and speaker wires. With most decent ones, these are less likely to be the bottleneck in most cases.
Also, its not just the individual pieces but how they interface together in terms of impedance that also matters for best dynamics. Higher ratios of device input impedance to output impedance of the device feeding it will help assure that dynamics are retained at each step in the component chain.
A common mistake that often results in bad dynamics is using a high output impedance tube pre-amp with a lwoer input impedance SS amp not designed to work well with a tube pre-amp. or similarly, a tube output source device like a DAC used with a pre-amp with lower input impedance. Both together would be a double whammy in terms of dynamics. However, a combo like this might sound very good in other ways, ie not fatiguing, smooth, involving, etc.
Another is having small or underbuilt speakers that cannot handle dynamics sufficiently,
A third is having an amp that is underpowered or not capable of driving a good pair of speakers properly to to their maximum potential.