Motorcycle helmets are generally composed of a kevlar, fiberglass or carbon fiber shell and an expanded polystyrene (EPS) foam. Provided it is not exposed to excessive salts (think salt water) or carbon (don't roll around in carbon rich soil or bathe in milk?), the shell is pretty slow to lose structural integrity. However, the EPS will start to break down almost immediately.
Most people know that polystyrene (styrofoam coffee cups, etc.) takes a really long time to fully decompose in a landfill--it takes approximately 10 million years to fully decompose. However, it would only take 100 years for your motorcycle helmet to become a pile of styrofoam grains--sand. So, over a period of 10 years, that helmet is already 10% dust. Not something with good structural integrity much less something you really want to trust with your brain.
When originally determining acceptable helmet parameters, the helmet should meet the standard DOT requirements
or whatever similar certification. However, many of these standards do NOT provide standards for old or used helmets. The failure rate for a helmet that is not OVER-engineered will increase as the foam decomposes.
Wearing an old helmet is like using old tires on your car. It is up to you to decide if you want to take the chance. But I can guarantee you that some people who know more about the failure rates than anyone here decided that 7 years is long enough, and I would be willing to bet that that is even longer than is a good idea. They don't want to throw out old stock any more than you want to buy a new one, and at a small failure level they are just fine with paying the settlements rather than throwing them out. YOU, however, only get one head.