On topic: I think they order them preprogrammed by Espressif. I am pretty sure Espressif has a facility where they can program the (flash) chip when it hasn't even been packaged yet (bare die), which is probably easier than doing it while packaged. The die must be tested before packaging anyway. Also, when they have access to the die, they can probably use other means of programming, directly to the flash chip instead of using the processor, either using SPI or even another way.
On topic: I think they order them preprogrammed by Espressif. I am pretty sure Espressif has a facility where they can program the (flash) chip when it hasn't even been packaged yet (bare die), which is probably easier than doing it while packaged. The die must be tested before packaging anyway. Also, when they have access to the die, they can probably use other means of programming, directly to the flash chip instead of using the processor, either using SPI or even another way.