The difference is, as others have pointed out, a Petrol car burns 100% petrol for it's lifetime. It only ever uses that without modification (even then only really to LPG). You then have extra fuel used to transport that petrol, a lot of energy to produce that petrol and quite a lot of burning of fuel and energy to extract it.
If you drive an electric car today in the UK, you are using about 8% coal, 20% nuclear, 45% gas and 10% wind and then a combination of Pumped storage, hydro, biomass, solar and some imported electricity. Over the lifetime of the car this is likely to change more in the non-CO2 direction and you car will get the 'upgrade' instantly and for free.
Combined with the fact that electricity can be generated away from major built-up areas means that the urban pollution can be reduced as well.