Cravings are temporary. If you voluntarily chose to stop eating certain foods for a few weeks, you will stop craving them. Brain learns there are other foods that satiate hunger, and whenever it feels peckish it will make you think of them instead.
So the good news is that the struggle is temporary. Bad news is that cheat meals reset your progress, especially cheat meals when you're hungry. And research suggests this is not related to how much you eat. A slice of pizza or a whole pizza, it's enough to make the brain remember that pizza is good when you're hungry.
IME it's no longer an addictive kind of craving at that point, it's just a thought that went through my head. For example, "I haven't had pizza in a while, it might be nice to try a couple slices and put the rest away. I can go back to eating healthy tomorrow."
If a relapse happens, it's because I had a good experience and kept going down that train of thought but with other foods. "Hey, that reminds me, I haven't had chocolate in a while, wonder what that's like..."
Main reason is that they don't know this, so they relapse by accident.
This fits very well of people gaining weight around the holidays, when you're exposed to lots of delicious food that's outside the daily diet. And once they do this, next time they're hungry you can bet that vegetable rice will not be the first thing that pops into their heads. Doesn't help that we tend to starve ourselves before big meals out of guilt, which only makes the habituation stronger.
Another reason is the "voluntary" part. It helps a lot if giving up food is a choice, as opposed to something imposed by a diet. If you see cake, make a cost-benefit calculation and decide that it's nice but doesn't fit into your lifestyle, you're likely better of than if you decide one day that cake is forbidden because it's bad.
So the good news is that the struggle is temporary. Bad news is that cheat meals reset your progress, especially cheat meals when you're hungry. And research suggests this is not related to how much you eat. A slice of pizza or a whole pizza, it's enough to make the brain remember that pizza is good when you're hungry.