In a liquid state, the particles are still held together by intermolecular forces, but these forces are weaker than in a solid. This allows the particles to move more freely and to take on the shape of their container. The particles in a liquid are close together, but not as close as in a solid. They can move past each other, but they are still attracted to each other.
In a gas state, the particles are very far apart from each other and have very little intermolecular force between them. This allows the particles to move very freely and to take on the shape and volume of their container. The particles in a gas are so far apart that they can move past each other without colliding very often.