Correlation is not causation. RCTs of sunscreen show 30-50% reduction in melanoma risk.
Randomized Control Trial