system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How does electronic data storage work?

When I speak of data storage, I'm referring to anything that is used for storage purposes. For example, what differentiates the methods of storage between credit cards, CDs, cassette tape, USB drives, etc? 

I have always been curious about this kind of technology that we take for granted, as I was never taught how it works in school.
gpt
The history of computer data storage is long and super interesting. Lots of people have had lots of interesting ideas about how to convert some observed physical phenomenon (like magnetism) into something that a computer can use. Some of the early computer were even designed with one type of memory, and then some totally different but better kind came along, and the computer would be retrofitted with the new memory.

Credit card use a magnetic stripe. You might have made a little magnet as a kid: you take an ordinary needle, stroke it against a magnet, and it turns the needle magnetic. Well, it turns out that you can place a magnetic film on a long roll of "substrate" (usually plastic these days). The magnetic film is really a whole series of little "islands"; each island can be magnetized separately. If you "zap" one portion of the tape a jolt of electricity (technically: make a strong, directional electric field) it will magnetize just the islands close to the field. The little fields can be "read" separately. 

You can also put the magnetic "stuff" on a disk, and you get a disk drive, or onto a drum, and get a drum. Drums are long obsolete.

CDs work totally differently. With a CD, you zap it with a laser, and burns a little pit in the plastic substrate. Or, the CD is made with a sort of dye solution, and zapping it with a laser simply turns the dye a different color.

USB drives use what's called "flash" memory; it's fully electrical and uses little capacitors to hold or not hold a small electrical charge.

And, over the decades, people have come up with dozens of other mechanisms. IBM once made a giant micro-fiche machine: you give it a bunch of data at once, and it would flash lights in a pattern at unexposed film stock. The machine would then automatically process the film and place it into a little niche where it could be read from afterwards.