You’ve asked a good question. Sometimes researchers can pinpoint one or two factors that clearly make a difference. Special math formulas are used to analyze the data. Statistical analysis helps sort out some of these things.
In other cases, it’s not always clear how the results were affected by surgery versus something else like rehab. If the study doesn’t evaluate other factors there may be no way of knowing.
Many researchers report the limitations they see in their own studies. They may point out areas that weren’t studied or weaknesses in the way the study was done. You may have hit on one of the key differences from study to study.