The amount of food energy in a particular food could be measured by completely burning the dried food in a bomb calorimeter, a method known as direct calorimetry. However, the values given on food labels are not determined this way, because it overestimates the amount of energy that the human digestive system can extract, by also burning dietary fiber. Moreover, not all food energy eaten is actually resorbed by the body (fecal and urinal losses). Instead, standardized chemical tests or an analysis of the recipe using reference tables for common ingredients are used to estimate the product's digestible constituents (protein, carbohydrate, fat, etc.). These results are then converted into an equivalent energy value based on a standardized table of energy densities.
It's all a bit furry and a lot of guesswork, as no two people process the same food the same way. You can use the calories as a rough guide, but I wouldn't rely on calculating anything very accurately.
At the end of the day you need to find out what works for you. You can't get an accurate BMR number from any chart.
To lose weight you need to either consume less calories or change the way you handle calories (raise your BMR).
Some people are happy to punish themselves and cut calories (and possibly add in a lot of cardio). Most people just can't sustain it (esp. as they get older). You also lose muscle this way as your body is effectively in starvation mode.
Others have great results raising fat intake and lowering carbs to change BMR. You can also IF or lift weights to enhance this (and build muscle). You then rely on satiety to control calorie intake. Again this requires willpower to cut carbs very low and lots of people can't manage it.
The "Seven Deadly Sins"
Grains (wheat/rice/oats etc) . . . . . Dairy (milk/yogurt/butter/cheese etc) . . . . . Nightshades (peppers/tomato/eggplant etc)
Tubers (potato/arrowroot etc) . . . Modernly palatable (cashews/olives etc) . . . Refined foods (salt/sugars etc )
Legumes (soy/beans/peas etc)