This question reaches back 35-40 years, which is almost the stone age in integrated circuits.
40 years ago the only viable choice for high density memory was a mask-programmed ROM. A memory chip was fabricated up to the final metal layer, which contained the links to encode the program. A customer would provide the programming, a final mask was made, and the chips would be finished and packaged.
The was way less involved than you might imagine. The difficult and risky steps are creating the semiconductors with deposition and diffusion. These steps can take weeks. Specifically each diffusion step can take up to a day of high temperature baking, and an entire batch can be ruined by an impurity. In contrast a metal deposition layer can be done in a few minutes. It's just exposing the photoresist (under a minute), cleaning, flashing the metal layer (five minutes to pull a vacuum, a few seconds to flash) and cleaning again. If you screw up, you can etch off the metal and try again.
And the mask wasn't expensive. The feature sizes were relatively huge, and masks could be made in-house. Sometimes it was as simple as rubylith film dots laid out by hand. A pair of clerical-level staff would call and lay out the rubylith dots in an hour or so.
The other approach was fused PROMs. They had thin metal strips at each matrix point that could be vaporized. The downside was that the chip had to be physically larger, and the voltage and impulse energy had to be carefully managed to vaporize the fuse completely without damaging the chip structure. PROMs were usually limited to low capacity chips that held configuration information rather than program memory.
Once EPROMs arrived, the game changed completely. They die was more expensive than mask ROM, but masks were getting expensive. Decreasing feature size and increasing memory size meant that making masks was outsourced to specialty companies. That increased cost and turn-around time. Pretty quickly OTP EPROMs in cheap plastic packages dominated, with mask-programmed ROMs only used for large-volume parts (primarily game cartridges).
On a personal note, I built my first EPROM programmer in 1980 or 1981 using three "precision discharged" 9V batteries for the 24V power supply needed for programming (25-26V volts supplied). I was extremely careful because I didn't want to waste the then-expensive parts. Luckily for my student budget it worked the first time.