When the vehicle is not in use (and the ambient temperature is high enough), a slight vapor pressure is developed in the gas tank from flashed off gasoline.
If the evaporative emissions system is installed and functional, these vapors are led out of the tank and up to the canister. The canister has a quantity of charcoal in it. Charcoal has the ability to absorb petroleum vapors (to a degree). The vapors come out of the gas tank vent line and are stored within the charcoal when the engine is not using fuel.
When the engine is started - and a vacuum is created in the intake system - these stored vapors are extracted from the charcoal. They are led to the carburetor/throttle body and pulled into the combustion chamber along with the combustion air stream. Once in the combustion chamber they are burned off.
But the charcoal can only hold so much vapor. Imagine your car sitting in a hot airport parking lot for two weeks while you are "gone fishin". The first couple of days, the charcoal quickly sucks up all the vapors from the tank. The third day it can't take it as fast and by the end of the week - it's completely saturated.
But the sun continues to beat down and the gasoline continues to flash off. As it flashes off (and with the evaporative emissions system full to capacity) pressure begins to build within the tank. As much as they don't want any gasoline vapors escaping to atmosphere, the designers of these systems had to leave a fail safe method of venting the tank.
The gas cap, in addition to just acting as a cover to keep dirt out of your tank, is still a pressure/vacuum relieving device - just like in the old pre-EPA days. It incorporates a dual acting, spring loaded valve that allows excess pressure (above a pre-determined point) to vent. Also, when the tank is subjected to a high negative pressure, it will open and allow air in to break the vacuum.