How does a hard drive store data without losing it?
A hard drive stores data using magnetic platters coated with a thin layer of ferromagnetic material. Tiny regions on the platter surface are magnetized in different orientations to represent binary 1s and 0s. A read/write head moves across the spinning platter and either aligns these magnetic regions in a specific direction to write data or detects their orientation to read it back.
The key to retaining data without power is that magnetic orientations are stable and don't require electricity to maintain their state. The ferromagnetic material holds its magnetization indefinitely unless exposed to a strong external magnetic field, physical damage, or extreme heat. This is fundamentally different from RAM, which loses its data the moment power is cut.