This is the killer feature of Semaglutide and GLP1 Receptor Agonists widely. They were originally commonly thought about as digestion-slowing, and while that is part of it, the real change is that it's a brain drug.
Uh, so, first, I'll say that bariatric surgery is largely a successful (if extremely invasive) intervention. It is not the case that people who do that surgery somehow compensate eat back to the same level -- on average, they don't. And second, the GLP-1s just massively reduce the urge to snack/eat. I'm sure they are less effective for some people than others, but on the whole they are miraculously effective for the population that overate habitually (the obese).