Study after study has shown that dieting alone is not effective for long-term weight loss. Roughly 95% of people gain back all the weight they lose from dieting, and often more. Most bariatric surgery patients, on the other hand, maintain weight loss of at least 50% of their excess weight long-term. Many bariatric surgery patients do regain some weight, sometimes a significant amount, but typically still maintain some amount of weight loss (whereas without surgery, they’d most likely be gaining steadily over the years).
The amount you can eat after weight loss surgery gradually increases, but usually not to the point that you can eat as much as you used to. People call the first couple of years the “honeymoon period” because that’s when it’s easy to lose weight, since the restriction is strongest. WLS also changes the hormones in your body that cause hunger, so at least for a while, you don’t feel hungry. They say it’s important to take advantage of the honeymoon period to change your eating habits so they become permanent even when the effects of the surgery weaken. Some people experience changes in taste after surgery and come to dislike sugary or fried foods (and these foods can even make you sick after WLS, which creates a strong disincentive to eat them).
So yes, it still takes work and lifestyle changes to lose weight and maintain weight loss after WLS, but WLS makes it easier than dieting. Many, many people who have repeatedly failed at weight loss through dieting alone have been able to succeed with WLS. (FYI, I’m only 7 weeks out from surgery, so I don’t have personal experience to back this up, but I’ve read a lot and watched a lot of videos from people who have been through it. There a lot of people on this forum with amazing success stories.)