The simple idea
The rhythm generator: groups of neurons in the medulla (including the preBötzinger complex) fire rhythmically to drive the diaphragm via the phrenic nerve (C3–C5). Circuits in the pons smooth the transition between breathing in and out. The cortex can override this — we can hold our breath, speak and sing — but not for long.