The total amount of cars needed each year is a combination of people getting one for the first time and others who are replacing one. That car that is replaced, assuming it's not being resold, is material that could reenter the system.
Also moving pulling back this debate to more general topics:
1.We don't need to replace all cars, many older gas powered cars will still be on the road for a long time which buys time for points 2-4
2. There are other types of batteries, like NiMH, which don't contain lithium. Although these aren't as efficient many hybrids use them, I think the new Mavrick hybrid does (or some truck hybrid)
3. There could be new battery technology that will be invented
4.New technology has helped Tesla make more energy dense batteries and have them last longer
A 2016 model s with the 70kwh battery pack has a 200 miles of range
A 2022 Model s performance with a 98kwh battery pack has a range of 326 miles
(this is a touch comparison because the new performance has much more power)