It’s good to know how long they last too.
More expensive than replacing a transmission yet doesn’t last as long as that I believe.
The federal requirement for an EV battery warranty is 8 years or 100K miles. A few states require better warranties and some companies offer better warranties. Most companies will replace the battery if the battery capacity falls below 70%. The general rule of thumb is the battery will lose 2% of capacity per year. It really depends on how the car is charged and driven.