Technically, that magnetic spinning HDD can work even after decades if maintained safely (no dust, no extreme heat) and without stress, even if it is not switched on for years.
In fact, if a magnetic HDD crashes, you may still recover some or all of the data by doing something hardcore, such as letting it sit for some hours in the freezer of your refrigerator, or immersing it in a bowl of rice overnight.
However, SSDs (and other flash storage devices) need to be switched on once in few months, otherwise there's a chance that some data stored in them may be permanently lost, as some cells may loose their power.
In fact, if a magnetic HDD crashes, you may still recover some or all of the data by doing something hardcore, such as letting it sit for some hours in the freezer of your refrigerator, or immersing it in a bowl of rice overnight.
However, SSDs (and other flash storage devices) need to be switched on once in few months, otherwise there's a chance that some data stored in them may be permanently lost, as some cells may loose their power.
"As a reminder, an SSD's endurance rating is calculated based on how long it can store data if left unplugged after a certain amount of data has been written": https://www.tomshardware.com/pc-components/storage/unpowered...