producing an EV battery creates more initial pollution (carbon debt) than building a gas car, mainly from mining/processing minerals and energy-intensive battery manufacturing, but over its lifetime, an EV emits significantly less total pollution because it has zero tailpipe emissions and offsets its "carbon debt" within 1-2 years, with cleaner grids and battery tech making it even better over time
https://www.epa.gov/greenvehicles/electric-vehicle-myths