Why are the gas laws (such as Boyle's Law, Charles's Law, and Avogadro's Law) only applicable to gas and not liquids or solids?
Gases, liquids and solids have different interactions between their components
Ultimately they are applicable to gases because they only apply to gases. The reasons why they work are worth understanding, though, because they are critical to the development of chemistry which might not exist if not fro some of the convenient properties of gases.
The most important law is that a given number of atoms or molecules as a gas always occupies the same volume if temperature and pressure are fixed. This was what allowed the generation of data that formed the basis of modern chemistry: things combine in fixed ratios. This led to the experimental proofs of the existence of atoms which would be a lot harder to do if we had to rely on measuring the volumes of solids or liquids where the volume tells us nothing useful about how much stuff makes up the substance. It is easy to measure the volume of a gas.
But why is this true? The essence of the reason why gases make up a fixed volume whatever they are made of, is that, to a good approximation, in gases the component parts are small, far apart and have only elastic interactions. If you do the statistics of such a system a whole bunch of apparently relevant factors cancel out (like the mass and velocity of the particles) to give a system which obeys the key gas laws independently of the molecule or atom making up the gas.
But this only works in gases. Liquids have strong interactions between their molecules; not strong enough to prevent individual molecules wandering around randomly but strong enough to hold them to a fixed volume without needing a container (gases will expand to infinite volume without a container to prevent them diffusing into the atmosphere). Solids have even stronger interactions that hold their individual molecules or atoms in a well defined location. The specific properties of solids and liquids depend on the details of those forces and, since there are a wide variety of forces and force strengths, the collective properties are a lot more complex.
In gases, the ideal gas-law approximations are good because the molecules of the substance have enough energy to break the attractive forces that would otherwise make them solids or liquids. Once free of those attractive forces they tend to occupy a much larger volume and their behaviour becomes better explained by the (simpler) gas laws as we can start ignoring the complexity of the attractive forces.
But the gas laws are an approximation. If they were not, nothing would ever liquefy or solidify. But the hotter a gas gets the more it behaves ideally as the less the attractive forces are relevant to the behaviour of the gas.
These laws, by definition, apply only to an ideal gas, that is, gasses that behave in a manner interpretable via. a one-size-fits-all mathematical model. Some characteristics specific to an ideal gas include:
- No intermolecular interactions between particles/molecules.
- They occupy a negligible volume.
- The particles/molecules travel randomly.
- Completely elastic collisions occur between particles.
In the case of conditions 1 and 2, liquids and solids cannot fulfill these criteria due to the presence of intermolecular attractions between atoms, which provide their characteristic shape and properties (as opposed to gasses).
Even still, in reality, it is usually only low-molecular-weight or high-temperature gasses which predictably follow the stoichiometry of these laws.