It’s an epistemic difference. In one case you have empirical evidence that A -> B even though the whole thing is a black box and really it only works sometimes. In the other, theory-based case, you have a model of how things work and that model has been predictive in some cases.
In medicine sometimes (more in the “old days”) someone would see that compound X caused Y and then they’d try to make a therapy that helped the patient without killing them. Other times, someone has a theory that pathway P seems to cause indication I, and so tries to develop a compound that relatively safely disrupts P in vitro, then tries it in vivo. Sometimes even after the drug works and is approved we later find the pathway P hypothesis was wrong, yet it somehow works anyway. And then people try to figure out what’s really going on.
And then, especially in psych and oncolo drugs, the meds mysteriously work on some people but not others. Teasing that out is tough.