Ketogenesis is the biochemical process through which organisms produce ketone bodies by breaking down fatty acids and ketogenic amino acids. The process supplies energy  to certain organs, particularly the brain, heart and skeletal muscle, under specific scenarios including fasting, caloric restriction, sleep, or others. (In rare metabolic diseases, insufficient gluconeogenesis can cause excessive ketogenesis and hypoglycemia, which may lead to the life-threatening condition known as non-diabetic ketoacidosis.)
Ketone bodies are not obligately produced from fatty acids; rather a meaningful amount of them is synthesized only in a situation of carbohydrate and protein insufficiency, where only fatty acids are readily available as fuel for their production.
Recent evidence suggests that glial cells are ketogenic, supplying neurons with locally synthesized ketone bodies to sustain cognitive processes.