As the study notes, they controlled for at least some of these:
> lower risks for all-cause mortality after adjustment for lifestyle, sociodemographic, and clinical factors
"clinical factors" would include diagnosed diabetes or anything else available from a medical record. "lifestyle" includes actual weight, though presumably not intent.
The data they used came from UK Biobank ("Baseline demographic, lifestyle, and dietary data from the UK Biobank"), which is quite complete: https://www.ukbiobank.ac.uk/
Of course, they can't control for everything, but they can control for a lot of the first 20 or 30 things someone would think of… and that probably includes everything you listed.