Gas molecules keep their distance from each other and are in constant motion. They continue to move in one direction until they come into contact with an object. Gas expands when placed in a closed container. The molecules continue to move about, filling the container. They strike the sides of the container, and each hit creates pressure. Three factors affect the pressure of the closed container.
Gas pressure in a closed container is the result of the gas molecules hitting the inside of the container. The molecules move about and are attempting to escape the container. When they cannot escape, they strike the inside wall and then bounce around. The more molecules striking the inside wall of the container, the greater the pressure. This concept represents the kinetic theory of gases.
Turning Up the Heat
Changing the temperature affects pressure in a closed container. Raise the temperature, and the pressure increases. This occurs due to the increased movement of the gas molecules. Double the temperature, and you double the pressure. This explains why aerosol cans have warnings about exposure to heat. Throw an aerosol can into a fire and it will explode at the point when its walls can no longer withstand the increased pressure of its contents. Two French scientists, Jacques Charles and Joseph Louis Gay-Lussac, first demonstrated this principle; the law explaining it bears their names.
More Pressure, Lower Volume
The volume of a gas and its pressure are inversely related. Decrease the volume, and the pressure increases. This relationship is called Boyle's law in honor of Robert Boyle who first observed that increased pressure lowered volume. As the volume a gas occupies decreases, the molecules of the gas are forced closer together, but their movement continues. They have less distance to travel to impact the container walls so they strike more often, thus creating more pressure. This factor is the basis for the automobile piston. It compacts the air-fuel mixture in the cylinder, thereby increasing pressure within the cylinder.
Density of the Gas
Increase the number of particles in a container, and the pressure of the system within the container increases. More molecules mean more hits against the container walls. Increasing the number of particles means you have increased the density of the gas. This third factor is part of the ideal gas law, which explains how these three factors -- temperature, volume and density -- interact with each other.