AI aside we don't really know how many calories a given person will get from eating a given piece of food. We measure food's calories by burning it, but we don't get nearly all that energy from dissolving it (just consider the fact that solid human waste burns, for instance). At best we've established some (fairly broad) minima and maxima.
We don't get it from raw bomb calorimetry ("Burn it and measure how hot it gets"). There are additional absorption coefficients applied before the nutrition label is printed. But for proteins, fats, and simple carbohydrates the coefficients are quite high (~95%), while progressively more complex carbs have a declining curve that ends in indigestible fiber. The difficulty is that the same person will digest more or less of the protein in their hamburger depending on how many fries they ate, how greasy those fries were, whether they ate lunch, and how much beer they drank that night. It's variable.
While this is strictly true - measurement of calories gives the upper bound of possible energy absorption. This makes it sufficient to calculate if TotalCaloriesIn >= TotalCaloriesOut. Obviously there are some biological complexities - but within the boundaries of the system the outcomes are constrained by the laws of thermodynamics.
add to that food calorie labels arent required to be 100% accurate, there's an acceptable range like +/- 20% iirc. That's enough to throw off a precise deficit. Calorie counting is more about directionally helping you lower your food consumption but it isnt as accurate as people think.
Honestly the main thing was learning that perfectly satisfying food I cook at home tends to land around 600-800 cal for a meal, where eating out almost anywhere is often twice that, even if my beverage is water. Just being aware how how heavy those otherwise delightful meals are gives me pause. Granted these figures are all a side effect of my personal eating habits and preferences, but that's rather the point of the exercise isn't it? There's a lot of individual variation, and the individual is probably best served by a personalized approach.
If I'm smart, I can offset this by eating half of that meal in the restaurant and taking the rest in a to-go container. Two meals for the price of one, and reheating in the oven is almost as convenient.
Separately though, I have no idea why restaurants seem to exclusively offer gigantic portions over here. I wonder how common this is elsewhere in the world? I'm not well traveled so I genuinely have no idea.
Presumably the recommended daily calorie intake figures (and the calculators for these) do to some extent take this into account? i.e. I would imagine they're based on experimentally tested values rather than theoretical energy expenditure.