ESP8266 (or ESP32) is connected to the Internet and check the firmware version. If suddenly the version is updated - ESP downloads the update and updates the Arduino UNO, which will be connected via UART. I found examples when OTA updates are performed by ESP, but ESP itself was updated there, not UNO.