There is a famous story of a frenchman who had gone to explore caves for what he thought was a day. He was found thirty eight days later. During that period, he had no food and while there was water in the cave, after a point, he had little energy to even get the water. During this period, his body consumed the fat and then the muscles of his body to survive. It did this by changing the bodies capacity to meet its energy requirement from nutrition to internally stored energy both as fat and muscle.
Everyday, your body too can go through a catabolic state. A catabolic state is one where your body breaks complex cells into simpler cells for example breaking protein into amino acids. It uses hormones such as adrenaline, cortisol, glucagon and cytokines in order to do this. A catabolic state can occur due to naturally occuring stress or because you have intentionally caused stress to your body by working out. Even just living your life causes catabolic states though in low intensity.
An anabolic state is the process by which your body builds, heals and repairs itself to survive. It does this by replacing lost cell cells, muscle tissue and fibre etc. It does this by making you eat your food and processing the nutrition into complex cells such as the muscles in your body. For you to survive your body needs to be in both a catabolic and an anabolic state through the day as these states work symbiotically also known as your circadian rhythm. Your weight is the net of your anabolic and catabolic state.
Therefore, to create a supervised catabolic state where you are deliberately stressing your body, you exercise and work out your different muscle groups to enable efficiency in catabolism. Once done, your body enters into its anabolic state to heal and repair itself from the stress that you just caused. This is the reason experts ask you to eat the right kinds of foods immediately after you have run, worked out or cycled etc. Your body needs the nutrition to repair itself, failing which it will consume its own body fat or worse muscle to meet its energy requirement. The quality and completeness of the nutrition just after a work out matters and therefore it is suggested to consume complete proteins immediately after a workout.