Our bodies need energy to keep us alive and our organs functioning normally. When we eat and drink, we put energy into our bodies.
To maintain a stable weight, the energy we put into our bodies must be the same as the energy we use by normal bodily functions and physical activity. An important part of a healthy diet is balancing the energy you put into your bodies with the energy you use.
A calorie surplus is a state in which you consume more calories than you burn leads to weight gain in the form of muscle or body fat. While a calorie surplus is required to gain weight, simply eating more only leads to unsightly body fat.
A caloric deficit is any shortage in the amount of calories consumed relative to the amount of calories required for maintenance of current body weight (energy homeostasis). A deficit can be created by reducing input/calories consumed (lower food intake, aka dieting. A deficit can also be created by increasing output without a corresponding increase in input. Increased output is created by increasing physical activity.