Something I learned a while ago that stuck with me is that it takes roughly the same electricity to refine oil to gasoline as an EV uses to drive the distance that gasoline would get you, and that only accounts for refining, not transport and storage of that gasoline, loss due to evaporation, etc.
In other words, you can pretty much ignore where the electricity comes from and EVs are still better than gas cars for the environment.
EVs are generally more wasteful to produce but their efficiency covers the excess in 1-2 years of operations, and can operate without meaningful maintaining for 200-300k+ miles and 15-20 years. There are no obvious upsides to ICE beyond political ideology.
Right I'm not making an argument about EVs generally either way, just saying that the cost of the energy used to propel them on the road wasn't the controversy.
For a lot of us, the question isn't "new EV vs. new ICE"; it's "new EV vs. current gen ICE".
I think the cost of energy to propel them was a common push-back. I've heard "the grid is dirty so EVs are dirty" from many people, and my point is that the grid composition essentially cancels out with oil refining, at which point EVs are "free" (to operate) while ICE vehicles still have to burn the fuel.
As for carbon intensity in production, I'd be interested to see a clear apples-to-apples comparison. High end products tend to have more emissions associated with them because they take more time, materials, transport, they're lower volume, higher waste etc. EVs have historically been high-end cars, or at least upper-mid market and up, there have been very few cheap EVs until recently, so if you compare the average ICEV to the average BEV, I'd expect the ICEV to be a lower end car, and possibly lower emissions by default as a result. Batteries will drag up emissions, but I'm not sure I've seen truly fair numbers on this.
In other words, you can pretty much ignore where the electricity comes from and EVs are still better than gas cars for the environment.