Interpretable inverse-designed cavity for on-chip nonlinear and quantum optics