Strong light-matter coupling within electromagnetic environments provides a promising path to modify and control chemical and physical processes. The origin of the enhancement of nonlinear optical processes such as second-harmonic and third-harmonic generation (SHG and THG) due to strong light-matter coupling is attributed to distinct physical effects which questions the relevance of strong coupling in these processes. In this work, we leverage a first-principles approach to investigate the origins of the experimentally observed enhancement of resonant SHG and THG under strong light-matter coupling. We find that the enhancement of the nonlinear conversion efficiency has its origins in a modification of the associated nonlinear optical susceptibilities as polaritonic resonances emerge in the nonlinear spectrum. Further, we find that the nonlinear conversion efficiency can be tuned by increasing the light-matter coupling strength. Finally, we provide a general framework to compute the harmonic generation spectra from the displacement field as opposed to the standard approach which computes the harmonic spectrum from the matter-only induced polarization. Our results address a key debate in the field, and pave the way for predicting and understanding quantum nonlinear optical phenomena in strongly coupled light-matter systems.