There’s usually more than one reason.
And, you should explore those, with help, if needed.
Do not dismiss all cravings using this as an excuse.
But I would like to mention that, for about 70,000 years, that’s exactly what your body evolved to do.
Cravings had a biological purpose: it was unlikely that you would find sweet, ripe fruit for a long time back then. So, when you found it, you ate as much as you could.
Back then, there were not supermarkets loaded with sweet things at every corner.
There are today.
Something to keep in mind: the way to fight 70,000 years of evolution starts with awareness.