The amount of nutrients like calories we need depends on factors like age, weight, and gender. The calories we need for our daily activities come from a process called metabolism that occurs in the body's cells. The standard method for determining the amount of protein in food is called the Kjeldahl method. About half the calories you consume should come from carbohydrates. The standard method for measuring fat content is called the Soxhlet extraction. Knowing about these things and how they affect your food and your lifestyle can help you become aware of ways to be healthier.
The word Calorie comes from a term chemists use called kilocalorie, which is the amount of energy it takes to raise 1 kilogram of water 1 degree C at sea level. The calorie content of food was determined in the late 1800s by Wilbur O. Atwater, an agricultural chemist. Measuring the protein content of food is similar to measuring its nitrogen content because nitrogen in food is contained mostly in proteins.
I was surprised at how much chemistry is involved in nutrition facts. I had no idea that a lot of these methods of measuring calories or proteins were invented by chemists. I think it's really cool how everyday things are so heavily influenced or a part of chemistry.