system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5:What are the actual physical changes that happen inside a computer while it's running?

Specifically curious about what it means to write something to memory: What happens inside a computer when I save a text file, or a Jpeg, or save a game, or anything else that changes the state of the computer from what it was before, to something else, and how it continues to exist after the computer is turned off.
gpt
Permanent storage in computers generally is done by one of two technologies.

For magnetic hard drives, there's a spinning plate covered with magnetic material and a mechanism that allows to detect and change the "direction" of the magnetism in very very small segments of that platter. So writing a file would involve that mechanism changing the magnetic pattern on the disk.

For solid state drives (SSD) in computers, as well as the common USB flash memory sticks, the memory consists of a silicon chip with lots and lots of very small isolated conducting spaces which can store electric charge (extra electrons), and transistors to control that. Writing to that memory involves storing electric charge in some (and removing from others) of these "pockets" called NAND cells.

Both of these things are somewhat permanent and continue to persist after power is turned off.