This is a thing where it is calories in/calories out, but that also obfuscates the complexity of the whole thing. Dieting reduces your calories in, but your body also adjusts its basal metabolic rate to adjust the lower average incoming calories. When you reach an equilibrium, it’s easier to maintain that diet since your body won’t be fighting you about calories anymore, but that does mean you’re no longer losing weight because the body has no reason to burn fat. This is why some people can really, really struggle to lose weight even with successful dieting. Their bodies just adjust too fast to the caloric deficit.
There are other reasons and I’m not a doctor or anything, but my main thing here is, like, don’t be fatphobic ig lol.