Yes, without a good experiment (maybe a natural one [1]) we can't know. Even if the study controls for everything observable, there may be unobserved differences that lead to the caffeination difference. For instance, even though two people might have the same job, education, etc. the one who is more ambitious, or creative, or hopeful, or simply healthy enough to feel like working more, might drink more coffee.
https://en.wikipedia.org/wiki/Natural_experiment?wprov=sfla1