We have studied potassium-intercalated bulk HfS$_2$ and HfSe$_2$ by combining transmission electron energy loss spectroscopy, angle-resolved photoemission spectroscopy and density functional theory calculations. Calculations of the formation energies and the evolution of the energies of the charge carrier plasmons as a function of the potassium content show that certain, low potassium concentrations $x$ are thermodynamically unstable. This leads to the coexistence of undoped and doped domains if the provided amount of the alkali metal is insufficient to saturate the whole crystal with the minimum thermodynamically stable potassium stoichiometry. Beyond this threshold concentration the domains disappear, while the alkali metal and charge carrier concentrations increase continuously upon further addition of potassium. At low intercalation levels, electron diffraction patterns indicate a significant degree of disorder in the crystal structure. The initial order in the out-of-plane direction is restored at high $x$ while the crystal layer thicknesses expand by 33-36%. Superstructures emerge parallel to the planes which we attribute to the distribution of the alkali metal rather than structural changes of the host materials. The in-plane lattice parameters change by not more than 1%. The introduction of potassium causes the formation of charge carrier plasmons. The observation of this semiconductor-to-metal transition is supported by calculations of the density of states (DOS) and band structures as well as angle-resolved photoemission spectroscopy. The calculated DOS hint at the presence of an almost ideal two-dimensional electron gas at the Fermi level for $x<0.6$. The plasmons exhibit quadratic momentum dispersions which is in agreement with the behavior expected for an ideal electron gas.