Car manufacturers have gone to great lengths to improve safety features on their vehicles. Fuel systems have a flapper valve that stops gas from flowing back out from the tank. While driving a car without a gas cap is not dangerous, it is not recommended. Over time driving without your fuel cap could cause a decrease in fuel efficiency, damage to your engine and harm the environment.
On vehicles manufactured after 1996, the "Check Engine" light will come on. Without the fuel cap, gas will start to evaporate. This could lead to engine misfires on some vehicles and decrease fuel pressure.
Dirt and other impurities could get in the fuel system, which could damage the engine.
The fuel system is designed to trap harmful gases and emissions that contribute to smog. If the cap is missing, these fumes will escape causing damage to the environment.