When your body switches to Fat-Burning Mode, ketones are released as a metabolic fuel.
The brain's only sources of energy are glucose and ketones. Consider ketones to be the body's backup power source.
When our forefathers were hunter-gatherers before agriculture, they fasted on a daily basis. When food was scarce, they had no choice but to wait for the right moment to go hunting and cooking.
They were unwittingly running on ketones due to their low carbohydrate and protein consumption. Converting stored fat into energy is a normal part of human life and is hardwired for our survival.
When glucose sources are low or exhausted, your body burns fat to use and generate ketones, such as:

if you're fasting after a long time of exercise and eating a ketogenic diet
Lipase (a fat-breaking enzyme) releases triglycerides that have been processed (fats). These fatty acids are transported to your liver, where they are converted to ketones.
Ketone bodies are divided into three categories:
Acetoacetate is formed first during the breakdown of long- and medium-chain fatty acids for energy.
Acetone – Acetone is formed naturally as a by-product of acetoacetate. When not in use, both of these ketone bodies leak into your urine and breath, making urine and breath monitoring a promising predictor of whether or not you're in ketosis. There's more on this in the section below.
Beta-hydroxybutyrate (BHB) is a molecule rather than a ketone. It counts as an essential ketone body because of its importance in the ketogenic diet. BHB is made from acetoacetate by the liver. Since BHB can freely float around your body in your blood, it can cross several tissues that other molecules can't. It reaches the mitochondria and is converted to ATP (adenosine triphosphate), the cells' energy currency.

ATP = BHB = power!