Planned Obsolescence. It's what made America rich, so of course your helmet's manufacturer sets a recommended service life--they want you to buy more helmets.
Helmet shells made using a fabric or fiber matrix impregnated with resin, either poured or pressure injected, such as those typically found on snowmobile helmets, will typically outlast all the other components in the helmet.
I used to build custom fit flight helmets for fighter pilots. Those helmets were disassembled, inspected and cleaned every month and we were very anal. If the paint accumulated too many dings we could and would strip them of parts, sand them down and repaint them. Those shells were thinner than the average motorcycle/snowmobile helmet and unless dropped or impacted those helmets would last a pilot up to his entire career. Ten years of hard use was more typical, but twenty years was not uncommon. We replaced liner systems every 1-2 years.
My point is if your helmet fits and has not sustained impact damage there is no practical reason to replace it. If you want a new helmet, by all means get one, but the protective qualities of your helmet don't "evaporate" with age.
Inspect it for deep scratches or gouges. Inspect the liner for dry-rot and the hardware for rust/corrosion. Check the chinstrap for damage, especially at the attachment point on the shell. If your helmet has a removable fabric liner/pad system you should remove that after any ride where it gets damp with sweat so everything dries out. You should wash the liner regularly.
If your helmet is compromised in any of these areas you should replace it but if it's undamaged and in otherwise good condition, wear it with confidence.