After how many years does the battery back of a pure EV or a hybrid or a plug-in hybrid EV have to be replaced? For example, my 3.5 year old iPhone X's battery needed replacing since it did not last me even half-a-day of regular usage. I am assuming that EVs run on more-or-less the same Li-ion battery tech. If I buy a Toyota RAV4 Prime today, does the usable range on the electric-only mode halve in 4 years?

Pardon me if its a noob question. I am new to the EV universe.