I have a 10-year-old EV and the battery is just fine. It hasn't really degraded much, either, and is still our family choice on trips under 600 miles.
Here's a recent synopsis that suggests 50% of the car value on average back in 2020 [1].
[1]: https://www.recurrentauto.com/research/costs-ev-battery-repl...
https://insideevs.com/news/717187/ev-battery-replacements-du...
A battery failure and a timing chain break or other types of complete engine failure before that mileage are comparable concerns -- similar rate of occurrence and similar cost to fix.
Battery costs are continually declining. If you buy an EV today, and then if you need to replace the battery in 15 years, because you put 300,000 miles on it, it won't break the bank.
https://insideevs.com/news/754979/hyundai-ioniq-5-400000-mil...