  The origin of the charge density wave (CDW) in transition metal
dichalcognides has been in hot debate and no conclusive agreement has been
reached. Here, we propose an ab-initio framework for an accurate description of
both Fermi surface nesting and electron-phonon coupling (EPC) and
systematically investigate their roles in the formation of CDW. Using monolayer
1H-NbSe$_2$ and 1T-VTe$_2$ as representative examples, we show that it is the
momentum-dependent EPC softens the phonon frequencies, which become imaginary
(phonon instabilities) at CDW vectors (indicating CDW formation). Besides, the
distribution of the CDW gap opening (electron instabilities) can be correctly
predicted only if EPC is included in the mean-field model. These results
emphasize the decisive role of EPC in the CDW formation. Our analytical process
is general and can be applied to other CDW systems.
