The calorie is a measure of energy. One dietary calorie contains 4.184 Joules of energy. It is true that all "calories" have the same energy content. However this does NOT mean that all calorie sources have the same effects on your body. Different foods go through different metabolic pathways and can have vastly different effects on hunger and the hormones that regulate body weight.
The foods you eat can also have a huge impact on the biological processes that control when, what and how much you eat.
High-Fibre, low sugar carbohydrates are slowly digested and don't lead to blood sugar and insulin spikes, while table sugar and white bread are quickly digested carbs that spike your sugar.
High protein diets have a metabolic advantage as protein takes more energy to metabolise. Whole foods also require more energy to digest than processed foods.
When tracking calories (no matter what your goal) be mindful of where you are getting your calories from.