Yes they have a shelf life, far more so with modern equipment than stuff made a couple decades ago.
1) CMOS battery will be dead or near enough.
2) Li-Ion battery pack will have drained to a non-recoverable state, practically speaking.
3) Electrolytic capacitors will have diminished function. They might re-form the foil if left powered on for a while (while most people would see a crash and turn it off instead, and in such a state, damage from overvoltage is more likely), or they might still be good enough to work considering there was no operational stress. Something made today will be less likely to have this issue as modern laptops tend to use solid/polymer capacitors in the switching power circuits that place the greatest demand on capacitors.
4) Hard drives will degrade. It's a mechanical device and needs to move every so often so metal migration and lubrication remains within check. That is not a guarantee that it won't work right after 10 years, but it cannot be assumed it will work correctly, still be within tolerances and not rapidly decay from excess bearing heat or wobble to cause head crash.
5) SSD will potentially degrade too but the problem is not isolated to SSD, rather the whole laptop as mentioned next.
6) Tin whiskers. Once the industry switched to lead free solder, anything with fine pitch solder leads and pads is prone to growing solder whiskers that cause electrical shorts. This is not corrosion, does not depend on external humidity or temperature extremes, although an ancient laptop built back when solder flux was rosin based instead of water soluble acid based, could have the flux absorb moisture form air and slowly cause corrosion, but while I can't put a date on when *most* of the industry switched away from rosin based solder, AFAIK every brand had by 10 years ago. Ironically something old enough to have rosin solder (or more often separate flux), would have lead based solder so no tin whiskers.