“There is no single explanation for food cravings, and explanations range from low serotonin levels affecting the brain centers for appetite to production of endorphins as a result of consuming fats and carbohydrates.
Foods with high levels of sugar glucose, such as chocolate, are more frequently craved than foods with lower sugar glucose, such as broccoli because when glucose interacts with opioid system in the brain an addictive triggering effect occurs.
The consumer of the glucose feels the urge to consume more glucose, much like an alcoholic, because the brain has become conditioned to release “happy hormones” every time glucose is present.
The craving of non-food items as food is called pica.” Source.