All food that you eat contain calories and in the process of digestion, your body breaks them down into calories which it then uses for energy. If you take any excess of calories, the calories don’t just disappear; they get stored away as fat. That’s why you gain weight if you eat too much, more than your body can burn.
This page explains more about the calories needed per day. The basic thing is to know how many calories are contained in each type of food so that if you really want to manage your daily calorie intake, you can gauge how much you’re getting. Nowadays most food contain labels which display the calorie content, and that helps somewhat to plan your meals.