What keeps the atoms or molecules in a solid, liquid, or gas together?
Intermolecular forces, or
van der Waals forces do. These forces are electrical in nature, and
London dispersion forces are the most common, for they exist between all atoms and molecules.
Dispersion forces result from the motion of electrons. Averaged over time, electron distribution around a given atom is symmetrical. At any given instant, however, the electron distribution may not be symmetrical. This brief unsymmetrical distribution gives the atom a short-lived dipole moment, which induces a temporary dipole in neighboring atoms, resulting in weak attractive forces between the atoms.
These forces are on the range of 1 to 10 kiloJoules/mol, relatively weak. The strength of the London dispersion force depends on the polarizability of the atom. A smaller or lighter molecule or atom is less polarizable and has weaker dispersion forces, because it has very few, tightly held electrons. Conversely, a heavy, large atom or molecule will experience stronger dispersion forces because it has a greater number of electrons.
Another factor that affects the strength of the dispersion force is molecular surface area. Spread-out shapes, which maximize molecular surface area and allow greater contact between molecules experience greater dispersion forces than more compact molecules. This is because a molecule with greater surface area will have more contact with a neighboring molecule than a less spread-out molecule.