It depends, I think generally source gear changes tend to be more apparent on speakers overall given equal tier comparison of headphones, but that being said depending on the headphone setup it can make an equal difference or possibly easier to hear on headphones. This entire comparison was done with headphone setups being the only thing used to evaluate for example. Depends on the tier of the headphones and the tier of the speakers as well. Imo a dac is going to make a larger sonic impact on a pair of midrange speakers rather than midrange headphones for example, but I think getting into the higher end side of things it can equal out at some point. But overall speakers just have a higher performance ceiling so eventually it will lean much more toward speakers as you continue to go up.
I can easily see that being the case depending on the specific setup at hand. Also really depends on what sonic aspects you are looking for. Anything spatial recreation wise is going to be more apparent on speakers than headphones imo, while perhaps let’s say resolving power might be more equally apparent on headphones and speakers. But it’s hard to make generalized statements that end up being mostly true, so I’ll just boil it down to it depends on the setups you are trying to compare imo