A battery pack for a Model 3 is $10K. So even if the whole car is only worth $20K, it's still worth keeping on the road.
The Porsche Taycan battery pack is $70K. The moment you have any issue at all with it, the car will be considered totaled.