Magnesium oxide has a giant 3D lattice structure formed by strong electrostatic forces of attraction between the positively charged magnesium ions and the negatively charged oxygen ions. These ionic bonds require a lot of energy to overcome, and therefore the substance has a high melting point.