A lack of quality sleep is linked to weight gain because sleep deprivation disrupts the brain chemicals that influence hunger; therefore, eating more calories ( think sugar and fat). Improved sleep from 6.5 to 7.5 hours a night contributes to feeling less hungry and eating fewer calories, AKA weight loss.
Reference:Tasali E, Wroblewski K, Kahn E, Kilkus J, Schoeller DA. Effect of Sleep Extension on Objectively Assessed Energy Intake Among Adults With Overweight in Real-life Settings: A Randomized Clinical Trial. JAMA Intern Med. 2022 Apr 1;182(4):365-374. Doi 10.1001/jamainternmed.2021.8098. PMID: 35129580; PMCID: PMC8822469.