@Jnetwork @Aetous the teacher may have confused hard drives with battery-backed storage mediums.
For example, SNES cartridges contain a battery that allows them to maintain game saves. As well, some motherboards have a battery that is used to keep the BIOS settings and other stuff persisted.
re: tech explanation
@Zauberin @Jnetwork @Aetous SSDs based on NAND flash will start losing data without power for a few years. Drive will typically be fine for a decade or so, but if it's worn out from a bunch of use this can be as little as one to two years.
https://web.archive.org/web/20170318101142/http://www.anandtech.com/show/9248/the-truth-about-ssd-data-retention