Your body uses the different foods that you consume for different purposes. Among some of the most common are meats and carbs. Carbs are what your body uses to produce energy, while meats are what your body uses to build its muscles.
With that in mind, keeping a balanced diet is important, because too much of one kind of food can actually cause problems for your body.
For example, if you overindulge on carbs, you'll have a protein deficiency, which results in your body breaking down its own muscles for the amino acids it needs. Conversely, if you eat too much meat, you'll experience a lack of energy intake, so your body will consume its own body fat and muscles to get what it needs.
By balancing your diet, your body won't consume itself. You'll consistently replenish what your body needs on a daily basis. Combined with exercise, a good diet will ensure that your body consistently gets what it needs from the outside without gaining too much weight or losing too much weight.