It's probably worth noting why cars are finally scrapped. It's usually not because of problems with the engine, but other issues that EVs also have. Rust (in Northern Europe this is a big thing), crash damage, generate state of disrepair. Of course EVs will remove some issues meaning the lifetime of cars may extend a little, but it's not going to increase it significantly.
By the very nature of lithium batteries EVs are basically throwaway cars after 10 years.
The cost of replacing an old battery pack quickly exceeds the value of the car. You might be able to get a few extra years refurbishing it but that’ll be expensive and require niche battery work that’ll be hard to find.
The oldest Teslas sold are now about 10 years old, and this epidemic of no-longer-holding-charge cars heading to battery replacement or scrapyards you speak of hasn't happened yet. From most accounts I've seen, the cars have 80-90% of their original capacity at 150-200k miles.