An EPROM stores each bit as charge trapped on an insulated ("floating") gate inside a transistor. The trapped charge stays for years without power, so the chip is non-volatile.
- Programming is electrical, with a device programmer.
- Erasing needs ultraviolet light. The package has a small quartz window over the chip; minutes under a UV lamp give the trapped charge enough energy to escape, wiping every bit at once.
That made EPROMs popular with developers in the 1980s and 1990s: program, test, erase, fix, program again. The cost is inconvenience. The chip has to come out of the circuit to be erased, and you can't erase just part of it.
An EEPROM removed both drawbacks by erasing electrically, in place, and flash later made electrical erasing dense and cheap. Plastic packages without a window, called OTP EPROMs, behave like a PROM: once programmed, they can't be erased.