system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do they find out the information that goes on Nutrition Facts labels?

Like number of calories, fat content, vitamin content, etc. etc.
gpt
There's a database of ingredients that has nutritional info for a variety of foods. When you make up a recipe you figure out the amount of nutrients and calories based on how much of each ingredient was used.

For each ingredient in the database, they dried out the food and burned it and measured how much energy was produced by the burning. The tool is called a calorimeter, and it's more or less an insulated box where you burn stuff in the bottom and have a bowl of water on top and measure how much the water temperature goes up (1 degree per cubic centimeter is a calorie).

For everything else, like vitamins, etc., they've worked out chemical procedures for separating out the materials in the food (generally by mashing and pouring a solvent over it and the pouring through a tube filled with special sand calleda "column"). They use special instruments that can identify the molecules and how much there is (the exact technique varies depending on the material).

The important part is that they don't run these tests on every food, just the basic ingredients. You can work out the nutritional content based on the recipe. Mind you, some of the cooking or processing might affect the nutritional content, so, in some cases they've tested foods cooked different ways. It's always an educated guess because foods vary in their nutritional value based on all sorts of things (like when it was harvested, how well it was watered, etc).