In going from solids to liquids to gases, molecules become progressively further and further away from each other. Molecules also more around more as you go from solids to liquids to gases.
Since gas molecules move around more than solid or liquid molecules, they have the most kinetic energy (energy of motion) of the three states of matter.
Diffusion is the random movement of a fluid (liquid or gas) from an area of higher concentration to an area of lower concentration. Diffusion is a result of the kinetic energy of particles of matter; atoms or molecules bounce around and mix until they are evenly distributed.