At petrol stations in Australia, there are always several signs that say "Turn off engine while refuelling" (or something of the sorts). Is this necessary to do, and why, or is just something that is required in older cars and no longer required in new cars? My question is regarding petrol engines, but I assume diesel is the same.
Here is a link from the API (American Petroleum Institute) website. http://www.api.org/oil-and-natural-gas/consumer-information/consumer-resources/staying-safe-pump
The article is called Staying safe at the pump. It talks a lot about static discharge among other things as sources of ignition. In most jurisdictions it is illegal to have an engine running while refueling. It is also against the law to smoke a cigarette within 25 feet (7.62 meters) of a fuel dispenser while in operation. As always it is better to be safe than dead.
When an engine is running there are multiple possible sources of ignition. Alternator or electric motor contact arcing. In older vehicles distributors could trigger flash fires or explosions. Fuel vapor is worse than liquid gasoline in terms of volatility. Considering what is directly underneath ... multiple large containers of fuel at about 20000 liters a pop.
Is it worth the risk to yourself and others?
Yes, it is necessary. When fueling, fuel vapor escapes, potentially creating a combustible mix. Plus there's always the possibility of an accidental spill.
A running engine adds an ignition source to this environment. Switching the engine off makes a fire less likely.
Mostly a 'just to be safe'. Modern cars will throw a check engine light is you pull the gas cap while the engine is running.