Do you know how calories were first "invented"?
Food was placed in a box and then placed in an aquarium. The food was then set on fire and burned.
The water temperature was measured to see by how many degrees a burning food increased it by.
Calories are only a unit of measure, and they called the amount of energy required to heat 1g of water by 1 degree Centigrade...
…a kiloCalorie.
That's all it is. A measure of energy released through heat.
A carrot cake heats the water by the same amount as three avocados. So a carrot cake and three avocados...
..have the same amount of calories...
But this does not mean they are "equal".
See how basing your eating only on calories might not be the best indication of quality?