It's basically a measurement of energy that our body uses as fuel. Food & drink contain calories and our body uses calories to make it function. Think of it like this - the food (calories) that we eat is fuel for our body.
Except now think what might happen if we have either too much or not enough fuel in our body. This is how we get either weight gain or weight loss. We all burn calories and use energy every day no matter what we are doing everyone has their own basic metabolic rate (amount of energy/calories burned to assume you were at rest all day- internally your body still has to function even when sleeping).
On top of this base amount of energy used each day there are more calories used when you are up and about. The more vigorous the movement, the more calories/energy used. ie; 10 minutes of running will use more calories than 10 minutes of walking.
It's important to know that our bodies, as well as lifestyles, are all different and therefore we each use unique amounts of calories or energy. To keep it simple- Let's say my body uses 2500 calories today, if I eat only 2000 calories then my body does not have enough calories from food to fuel it. So what happens then?
My body still needs the energy to function so if it cannot get it from food because I have not eaten enough then it will take it from somewhere else in my body which is generally going to be from stored fat (I won't go into huge detail around this) our body is clever. It wants to stay alive & functioning so if you have not eaten the number of calories that it needs to use then it will take the fuel from stored fat and you will, therefore, lose weight.
The same principle applies for weight gain if I ate 3000 calories and only used 2500 the excess 500 calories would be stored as fat (Unless you had been resistance training in which case some of this would go to muscle gain- won't go into detail).
Fun fact: 7700 calories equates to 1kg so if your body was in a deficit of 550 calories each day for two weeks (Your body took in 550 less calories than what it used) you would lose 1kg of stored body fat
Written by Adam, you can find more about him here.