The short answer is: yes ... kind of.
What escapes out of a loose or faulty gas cap is gas vapor. Gas vapor rises off of the pool of gasoline in the tank and hangs around in the air. When the pressure in the tank is too great, the vapor enters the fuel vapor canister through a small outlet in the filler neck of the gas tank. In the past the vapor was just vented out of the filler cap, but that was before anyone was aware of the impact that gas vapor has on air quality.
On top of lowering air quality, lost fuel vapor adds up to a good amount of lost fuel over several years. The fuel vapor canister lets vapor released along the fuel system be sent back into the fuel tank.
How to prevent a gas cap from leaking gas vapor
The gas cap on every vehicle should have directions either on it or near it explaining how it should be used in order to properly seal the fuel tank. The most common way to ensure a good seal is to listen for clicks that the cap makes while being tightened. Three clicks is the average, but some manufacturers use caps that click once or twice.
A loose gas cap may also trigger the Check Engine Light, so if the light pops on randomly (or right after filling up), tighten the gas cap again before further diagnostics are done.