Emotions, food cues and physical sensations can all affect eating. A craving or episode of eating does not, by itself, identify its cause.
Research reviews describe associations between food-cue reactivity, craving and eating behavior; those findings are not a diagnostic test for emotional or physical hunger.
If eating patterns are distressing or difficult to manage, a licensed healthcare professional can discuss support and treatment options suited to the individual.