Espressif’s esptool has a facility to automatically put the ESP32 into bootloader mode using the DTR and RTS signals of the serial interface.
For whatever reason, it is very unreliable. There are many schematics of knockoffs of Espressif’s original DevKits.
Above is the schematic of one of the larger makers of ESP32 modules, AI-Thinker. The auto-program facility is implemented in the logic gate arrangement at right top of the left top block. Continue reading ESP32 WROOM32 – A possible fix for failure of auto-program facility