The vapours are heavier than air and can become a serious problem. Their explosions can, e.g., be responsible for aircraft disasters where there are no survivors. Whereby in fact, the turbines of jet-engines are filled up with kerosene, which is more similar to Diesel fuel, and which is said, not to have this particular characteristic.
It is probably, as it often is, a combination of unfortunate circumstances. There are cables leading to the sensors in the tank and right next door, there are cables in the wiring harness which may carry high-voltage. If the insulation should become loosened, e.g., through vibrations, the conditions for a perfect uncontrolled ignition are present.
In the motor vehicle it's even worse, because the cables to the in-tank pump, carry far more current than is necessary for the sensors. Since one can empty a tank, right up to the last drop, it's actually a miracle, that that there are no significant accidents. This is probably because of the lack of air or that the mixture is still too rich, despite the tank being open.
Still, be careful when dealing with used tanks. Indeed, I'm thinking of a negative experience that I had with a VW-tank, where a slight leak was to be welded closed. Because of the number of openings, it could only be half filled with water. Despite shaking and swirling the water around, there were still enough petrol fumes in the tank to cause quite a bang.
Most tanks are pressurized.
Of course, the inhaling of the fumes, previously considered to be harmless, is indeed a health danger. This is why you should only fill-up in windy conditions (joke!). The fuel-supply trucks vacuum up the fumes, also those which occur when you're filling up, and return them to refinery. Even the fuel-gases occurring from the Diesel-injection testing devices are recovered.
Now, how is this problem solved in aircraft? Well, the same as it is with crude-oil tankers, nitrogen is pumped into the emptying tanks. Of course, this is quite simple when the tanker is tied up at the dock. In the case of the aircraft, the nitrogen is gained from the air while the aircraft is in flight, the air is pressed through a type of micro-filter, which can distinguish between thin oxygen- and the thicker nitrogen molecules. 07/14