From The Ketogenic Diet: Uses in Epilepsy and Other Neurologic Illnesses:-
"Inconsistencies in studies attempting to correlate seizure protection with levels of ketone bodies suggest that another mechanism may be involved in the diet’s beneficial effects on seizures. Several mechanisms have been proposed, including changes in ATP production making neurons more resilient in the face of metabolic demands during seizures; altered brain pH affecting neuronal excitability; direct inhibitory effects of ketone bodies or fatty acids on ion channels; and shifts in amino acid metabolism to favor the synthesis of the inhibitory neurotransmitter GABA."
GABA is an interesting neurotransmitter, as it's the chief inhibitory neurotransmitter in the mammalian central nervous system.
I know of two other substances that enhance GABA's effects - Alcohol and Benzodiazepines.
I'm in favour of ketogenic diets under medical supervision, as therapy for neurologic conditions etc.
I'm not in favour of ketogenic diets under lay supervision, as a supposed aid for weight loss.