Foods high in fats and simple carbohydrates have the highest calorific intake which are most conducive to survival. We've evolved to make this rewarding through the release of hormones such as serotonin when consuming foods high in macronutrients. There are other factors such as the specific makeup of the microbiome in your gut; the more junk food you eat, the more you crave it in the future as bacteria best adapted to breaking these foods down outcompete others.