You are correct that, according to Charles's Law and the ideal gas law, the volume of a gas is directly proportional to its temperature when pressure is held constant. This relationship can be expressed as:
V₁ / T₁ = V₂ / T₂
where V₁ and T₁ are the initial volume and temperature, respectively, and V₂ and T₂ are the final volume and temperature.
When the temperature of a gas increases while the pressure remains constant, the average kinetic energy of the gas molecules increases. As a result, the gas molecules move more vigorously and collide with the container walls more frequently and with greater force. These increased collisions exert more pressure on the container, causing the gas to expand and the volume to increase.
It's important to note that this relationship holds true when pressure is held constant. If the pressure is allowed to vary, other factors such as Boyle's Law (pressure-volume relationship) also come into play. The combined effect of these laws determines the final volume when both temperature and pressure change simultaneously.
In summary, when temperature increases while pressure is constant, the volume of a gas expands due to the increased kinetic energy of the gas molecules, which results in more frequent and forceful collisions with the container walls.