As with many things scientific, there are multiple levels of understanding that we can use to explain our observations. One of the more basic definitions of states of matter relies on macroscopic observations of those states of matter:
- Solid - definite shape, definite volume
- Liquid - variable shape (assumes the shape of its container), definite volume
- Gas - variable shape, variable volume (assumes the shape and volume of its container)
Those are great functional definitions and they are sufficient in many situations, but WHY do they work? That requires a little more detail. Most of the time when we want to answer a "why does stuff do what it does?" question, we have to look at the interaction of matter and energy, so in this case, let's look at the matter and energy considerations in states of matter.
Why is a solid a solid? On a molecular level, we could say that the atoms (or ions, or molecules) interact very strongly. In gases, the atoms (or ions, or molecules) do not interact. In liquids, the atoms (or ions, or molecules) interact moderately. Why do atoms (or ions, or molecules) "interact"? Well, because of intermolecular forces (IMFs)! The IMFs between particles in a solid are strong, liquids are weaker, gases are weaker still. IMFs to the rescue!
That's great when we are differentiating between rocks and water and helium, but it still falls a little short. What about water? Water can be a solid, liquid, or gas under pretty achievable conditions. Do the IMFs between water molecules change? Not really. So what does change when water changes state? In a solid, the molecules don't really move, but in a gas, they move very quickly. Motion is described by kinetic energy… so states of matter are really determined by the balance between the IMFs present in a substance and the Ekin of the atoms (or ions, or molecules) in the substance. If the IMFs are significantly stronger than the Ekin, then the atoms (or ions, or molecules) will tend to stick together and be solid; if the IMFs are significantly weaker than the Ekin, the material will be a gas. So we can make water (or pretty much anything) change from a solid to a liquid to a gas by increasing the Ekin of the molecules to the point where they overcome the energy of the IMFs holding those molecules together.
There are still some simplifications and assumptions in that explanation, but it's a good "next step" for us to use as we try to understand and explain the differences in states of matter.