Pretty sure you’re not finding a new engine for a BMW 5 series for $4000 and that’s a cheaper car than Tesla S/X
Interestingly, replacing the Nissan Leaf's worn out battery will cost ~$6000. Looking up the price of a Nissan Leaf I could buy from the closest car max: it'd cost ~$8000.
I wonder if vehicle manufacture (not necessarily battery) is going to be cheap enough to simply throw out your car whenever the battery dies?
It costs less to make an IC engine than to make an electric drivetrain. Replacement cost for a Tesla drivetrain is about $6000 - $15000. Replacement for an volume-product automotive engine is about $2,250 to $4,000. Detroit put a lot of effort over the years into making engine manufacture cheap.