The craving doesn’t come first, the food came first, followed by a particular food or food group thereafter, depending on what the organism needs.
A food satisfies you. Then you want the same satisfaction again.
It isn’t always a lacking of a particular nutrient that creates the crave, otherwise you’d be craving a lot of different foods at the same time, since most foods contain the same basic nutrients.
How many times did you crave carrots, because you had a vitamin A deficiency?

