Human beings need energy to survive — to breathe, move, pump blood — and they acquire this energy from food.
The number of calories in a food is a measure of how much potential energy that food possesses. A gram of carbohydrates has 4 calories, a gram of protein has 4 calories, and a gram of fat has 9 calories. Foods are a compilation of these three building blocks. So if you know how many carbohydrates, fats and proteins are in any given food, you know how many calories, or how much energy, that food contains.