A correlation says two variables move together, not why. Four explanations compete with "X causes Y": a confounder Z causes both; Y causes X (reverse causation); the sample was selected in a way that links them; or the pattern is chance, which becomes likely when you test many pairs.
Example: countries that eat more chocolate have won more Nobel prizes per capita, with a correlation of about 0.79 across 23 countries (Messerli, New England Journal of Medicine, 2012). Chocolate doesn't make laureates; national wealth is a plausible confounder that raises both chocolate consumption and research funding.
Randomized experiments, such as A/B tests, settle causation because assignment can't depend on anything else. With observational data, causal inference methods such as matching, difference-in-differences, instrumental variables and regression discontinuity get closer under stated assumptions. A good follow-up: smoking was shown to cause lung cancer without a randomized trial, from the strength, consistency and dose-response of the evidence that Austin Bradford Hill summarized in 1965.