Eric Jaffe:

The idea that gasoline cars might cause less environmental harm than electric vehicles seems impossibly backwards. But consider the following thought experiment before you dismiss it out of hand.
 A view from the tailpipe gives EVs a clear edge: no emissions, no pollution, no problem. Shift the view to that of a smokestack, though, and we get a much different picture. The EV that caused no environmental damage on the road during the day still needs to be charged at night. This requires a great deal of electricity generated by a power plant somewhere, and if that power plant runs on coal, it’s not hard to imagine it spewing more emissions from a smokestack than a comparable gas car coughed up from a tailpipe.