The helmet shall be replaced every five years or when it had a severe crash. Because after some passage of time the foam of the helmet starts loosening its impact and the foam gets compressed. Due to this compression, the protection reduces. After a severe accident, you should immediately change the helmet for your safety. If you don't Replace it, it will not protect you in your future accidents.
So five years are enough to use the same helmet because the technology will be better after five years. The new product will have better features and the latest technology.