  Using first principle calculations, we examine the sequence of phases in
electron doped dichalcogenides, such as recently realized in field-gated
MoS$_2$. Upon increasing the electron doping level, we observe a succession of
semiconducting, metallic, superconducting and charge density wave regimes, i.e.
in different order compared to the phase diagram of (semi-)metallic
dichalcogenides such as TiSe$_2$. Both instabilities trace back to a softening
of phonons which couple the electron populated conduction band minima. The
superconducting dome, calculated using Eliashberg theory, is found to fit the
experimentally observed phase diagram, obtained from resistivity measurements.
The charge density wave phase at higher electron doping concentrations as
predicted from instabilities in the phonon modes is further corroborated by
detecting the accompanying lattice deformation in density functional based
supercell relaxations. Upon charge density wave formation, doped MoS$_2$
remains metallic but undergoes a Lifschitz transition, where the number of
Fermi pockets is reduced.
