Charge-density-wave (CDW) order and superconductivity coexist in the kagome metals AV₃Sb₅~(A=K, Cs, Rb), raising fundamental questions about the mechanisms driving their intertwined phases. Here we combine high-resolution inelastic X-ray scattering with first-principles calculations to uncover the origin of CDW formation in CsV₃Sb₅. Guided by structure factor analysis, we identify a soft phonon mode along the reciprocal $\textit{M}-\textit{L}$ direction, with the strongest effect at the $\textit{L}$ point, where the elastic scattering intensity also grows most rapidly upon cooling. First-principles calculations incorporating lattice anharmonicity and electron-phonon coupling reproduce these observations and establish a soft-mode instability at the $\textit{L}$ point as the driving mechanism of CDW formation. Despite the weakly first-order character of the transition, our results unambiguously demonstrate that the CDW in CsV₃Sb₅ originates from a softened phonon, clarifying its microscopic origin and highlighting the central role of lattice dynamics in kagome metals.