You know the phrase "You are what you eat"? You're probably what your mother ate, too. A mother's diet while pregnant or breastfeeding can sway an infant toward developing a taste for sweet or salty foods.
Later, exposure to different foods can turn your tastes. Tastes associated with pleasant experiences are more likely to become favorites. Food cravings and choices in comfort food, for instance, can come from emotional rather than physical needs. Take chocolate: It does contain tryptophan, the amino acid needed to produce the mood-lifting chemical serotonin. But soybeans contain much more tryptophan -- and when did you last hear, "I need tofu right now"?