So-called spontaneous neuronal activity is a central hallmark of most nervous systems. Such non-causal firing is contrary to the tenet of spikes as a means of communication, and its origin and purpose remain unclear. Here, we propose that non-input driven firing can serve as a release valve to protect neurons from the toxic conditions arising in mitochondria from lower-than-baseline energy consumption. We built a framework of models that incorporate homeostatic control of metabolic products--ATP, ADP, and reactive oxygen species, among others--by way of changes in firing. Our theory can account for key features of neuronal activity observed in many experiments in studies ranging from ion channels function all the way to resting state dynamics. We propose an integrated, crucial role for metabolic spiking that bridges the gap between metabolic homeostasis and neuronal function. Finally, we make testable predictions to validate or falsify our theory.