This is true. That’s why therapy & understanding why you eat is a vital component of this process for many people. In the US a psychological assessment is part of the insurance approval process. In Australia, your surgeon recommends pre &/or post surgery therapy sessions.
The surgery affords many benefits that dieting &/or exercising alone does. It resets your body set point (the weight your body naturally gravitates to), boosts your metabolism, removes part of the area that produces the hunger hormone (ghrelin) & can affect the glp1 hormone that regulates hunger & the metabolism of glucose. There are also of course physical changes that restricts how much food you can eat.
You will have to change how & what you eat. (Many change when they eat too.) The surgery affords you the time to establish new habits, discover new foods & to work out what way of eating works best for you. I’ve tried many diets & I’m pig headed enough to stick to them for months without wavering but I’d always eventually go back to how & what I usually ate. I’ve never been able to maintain my weight like I can now. I made a decision to cut out a lot of sugar (real, artificial, substitutes) out of my diet. I don’t eat highly processed foods, avoid a lot of carbs & never have fast food. This has been what works for me. It may not work for you or complement your lifestyle.
I didn’t record my food intake & still don’t. I do random checks of my calories & regularly check nutrients & ingredients. The only thing I watch carefully is my protein. Some people find tracking very helpful but it isn’t for everyone all the time. Though you may be required to do it for a while to ensure you’re getting in the nutrients you need.
But you have to be ready to do this. As I said it’s not easy. It was harder than any other diet I’ve done.