The distance between particles determines the state of the substance. In a solid, particles are closely packed together and have strong attractive forces, resulting in a fixed shape and volume. In a liquid, particles are more spread out and have weaker attractive forces, allowing them to flow and take the shape of their container. In a gas, particles are far apart and have very weak attractive forces, causing them to move freely and occupy the entire space available. Therefore, the distance between particles plays a crucial role in determining whether a substance exists as a solid, liquid, or gas.