Fasting mimicking diets allow you to eat, but trick your body into thinking that it's fasting. They are low to moderate carbohydrate, low protein, moderate to high fat and limited calories. They are designed to allow you to consume some food, while still receiving the metabolic benefits of fasting.
When you fast, your body switches from using glucose and stored glycogen in the liver as the main source of fuel and uses fat, producing ketones as a bi-product. This is called metabolic switching or "the switch".