By means of first-principles density functional calculations, we study the maximally localised Wannier functions for the 2D transition metal dichalcogenides MX2 (M = Mo, W; X = S, Se, Te). We have found that part of the energy gap is opened by the crystal field splitting induced by the X-2-like atoms. The inversion of the band character between the Gamma and the K points of the Brillouin zone is due to the M-M hybridisation. The consequence of this inversion is the closure of the gap in absence of the M-X hybridisation. The M-X hybridisation is the only one that tends to open the gap at every k-point. It is found that the change in the M-X and M-M hybridisation is the main responsible for the difference in the gap between the different dichalcogenide materials. The inversion of the bands gives rise to different spinorbit splitting at Gamma and K point in the valence band. The different character of the gap at Gamma and K point offers the chance to manipulate the semiconducting properties of these compounds. For a bilayer system, the hybridisation between the out-of-plane orbitals and the hybridisation between the in-plane orbitals split the valence band respectively at the Gamma and K point. The splitting in the valence band is opened also without spin-orbit coupling and occurs due to the M-M and X-X hybridisation between the two monolayers. The transition from direct to indirect band gap is governed by the hybridisation between out-of-plane orbitals of different layers and in-plane orbitals of different layers.