Isostructural transitions in layered MX2 compounds are governed by competing van der Waals (vdW) and Coulomb interactions.