To flash a batch of GL.iNet routers, you need to use uboot auto update. You need to set up a tftp server first then connect each router to the server one by one to update.
You can also boot the devices in batch, then connect to each one using cable to update.
We have a tool written in Python to do this.
In either way, you need a usb power hub which can power up dozens of routers to do this.
In factory things are very different. Firmware are flashed to the flash chip before soldering to the PCB.