A fuel cap protects your fuel supply by providing a cover for the tank. It’s designed to prevent fuel loss and keep out contamination. Making sure your fuel cap is secured tightly will help decrease fuel loss from evaporation.
If your Check Engine light comes on, or if you are using fuel at a higher rate than usual, chances are your fuel cap needs replacing. Without a functioning fuel cap, gas will evaporate and reduce your fuel efficiency by up to 2%. If ignored long enough, you could eventually see damage to your fuel pump and filters.
From a safety standpoint there is a low risk, but you could run out of gas and be stranded. From an environmental point of view, a leaky fuel cap will cause gas to evaporate and increase your carbon footprint.