The molecules can move only when there are gaps or spaces between them, this space is called intermolecular space.
This intermolecular space also helps in categorizing matter into solid, liquid and gas. In solids molecular spacing is very little while in liquids is more as compared to solids and in gas it is maximum.