Melting points are determined by the strength of the attractive forces holding atoms together in the solid. In a solid, each atom has its own place, and their motion consists of vibration, or rocking back and forth in place. When a solid melts to become a liquid, the forces holding atoms together must be overcome enough to allow the atoms to move about freely (while remaining close together).
Energy is required to overcome the forces of attraction that hold atoms in place; the stronger the forces, the more energy is needed. As energy is added, the motions of atoms speed up. This increased motion, or kinetic energy, can be measured as temperature (temperature is related to the average kinetic energy of the atoms in a substance).
The melting point of a substance is the temperature at which the atoms have sufficient kinetic energy to overcome the attractive forces and move freely. This melting point depends on the strength of these forces. Since salt has a high melting point, we might infer that the forces holding its atoms together are strong. Salt (sodium chloride) is an ionic compound. The sodium atoms each give up one electron to form Na+, a positive ion, while the chlorine atoms each gain one electron from sodium, forming the negative ion Cl-. These oppositely charged ions are attracted to one another and form ionic bonds.
Ionic bonds are one of three types of chemical bonds. They are quite strong, in addition to which each charged atom (ion) in the solid is attracted to several near neighbors having the opposite charge. In sodium chloride, which is a cubic crystal, each ion has six near neighbors having the opposite charge. All of these ions thus have multiple strong attractions holding them in place. It requires considerable energy to “break the ions loose,” and the solid must be heated to a high temperature (801 degrees Celsius) before that occurs.
You can predict that two elements will form an ionic compound if, like sodium and chlorine, one element is a metal and the other is a nonmetal.