Sleep apnea is a condition where people experience partial or complete obstruction of their airways during sleep and stop breathing several times a night. It can can manifest as loud snoring, gasping, choking and daytime sleepiness and is believed to affect at least 7 percent of the population.

There is correlation between that and obesity, diabetes, cigarettes, and alcohol. There is no plausible biological mechanism for why those would cause sleep apnea, it is just correlation - epidemiologists look at rows of inputs and columns of effects - and that is the problem with a new paper claiming a link to cancer

Correlation papers are in the exploratory pile rather than the true science pile because science has not validated how it might be linked to any of those things. Misused it causes unnecessary panic. Smoking and alcohol are definitely risk factors for cancer, they are both class 1 carcinogens that have weight of evidence and not just suspect data dredging like International Agency for Research on Cancer engaged in most of this century. 

The data were 62,811 patients five years prior to the start of treatment for sleep apnea in Sweden. Between July 2010 and March 2018, patients were treated with continuous positive airway pressure (CPAP), which provides a positive pressure of air through a mask to keep the airways open during sleep. The researchers linked these data with data from the Swedish National Cancer Registry and socio-economic data from Statistics Sweden. They matched 2,093 patients with sleep apnea and a diagnosis of cancer up to five years before  sleep apnea diagnosis with a control group of 2,093 patients with sleep apnea  but no cancer. They measured the severity of sleep apnea with the apnoea hypopnea index (AHI), which measures the number of breathing disturbances during sleep, or the oxygen desaturation index (ODI), which measures how many times an hour levels of oxygen in the blood fall by at least 3% for ten seconds or longer.

Patients with cancer had slightly more severe sleep apnea, as measured by an apnoea hypopnea index average of 32 versus 30, and an oxygen desaturation index of 28 versus 26. In further analysis of subgroups, ODI was higher in patients with lung cancer (38 versus 27) prostate cancer (28 versus 24) and malignant melanoma (32 versus 25).

So there is a small association but no causal link. It also did not take into account numerous other lifestyle factors that could be involved.